Gatsby: Gatsby Cli error - SyntaxError: Unexpected token

Created on 13 Sep 2019  路  1Comment  路  Source: gatsbyjs/gatsby

Description

Installed gatsby-cli for the first time. And ran command "gatsby new"
It throws an error.

I tried uninstalling-reinstalling. As well as installing older versions.
But the issue persists.

None of the gatsby commands are working.

Steps to reproduce

npm install -g gatsby-cli

gatsby new gatsby-site

Produces error

Expected result

Should create new webapp directory with basic gatsby setup.

Actual result

gaurav$ gatsby new gatsby-site
/usr/local/lib/node_modules/gatsby-cli/node_modules/configstore/index.js:26
                                ...defaults,
                                ^^^

SyntaxError: Unexpected token ...
    at createScript (vm.js:74:10)
    at Object.runInThisContext (vm.js:116:10)
    at Module._compile (module.js:533:28)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:503:32)
    at tryModuleLoad (module.js:466:12)
    at Function.Module._load (module.js:458:3)
    at Module.require (module.js:513:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/event-storage.js:17:21)

Environment

Cant run any gatsby commands. They produce the same error.

Most helpful comment

Found the cause. Node version was old. Problem fixed as I updated Node to latest.

>All comments

Found the cause. Node version was old. Problem fixed as I updated Node to latest.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

andykais picture andykais  路  3Comments

ghost picture ghost  路  3Comments

rossPatton picture rossPatton  路  3Comments

jimfilippou picture jimfilippou  路  3Comments