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.
npm install -g gatsby-cli
gatsby new gatsby-site
Produces error
Should create new webapp directory with basic gatsby setup.
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)
Cant run any gatsby commands. They produce the same error.
Found the cause. Node version was old. Problem fixed as I updated Node to latest.
Most helpful comment
Found the cause. Node version was old. Problem fixed as I updated Node to latest.