Gatsby: async sendEvents() error immediately after install

Created on 22 Jul 2019  路  10Comments  路  Source: gatsbyjs/gatsby

Description

Install gatsby-cli by running command npm install -g gatsby-cli. Gatsby appears to install correctly. Attempt to create new Gatsby site by running command gatsby new test-site. Immediate error.

Steps to reproduce

  1. Install gatsby-cli by running command npm install -g gatsby-cli
  2. Gatsby appears to install correctly. Attempt to create new Gatsby site by running command gatsby new test-site.
  3. Immediate error:

gatsby new test-site /usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:306 async sendEvents() { ^^^^^^^^^^ SyntaxError: Unexpected identifier at Object.exports.runInThisContext (vm.js:76:16) at Module._compile (module.js:542:28) at Object.Module._extensions..js (module.js:579:10) at Module.load (module.js:487:32) at tryModuleLoad (module.js:446:12) at Function.Module._load (module.js:438:3) at Module.require (module.js:497:17) at require (internal/module.js:20:19) at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:3:19) at Module._compile (module.js:570:32)

Expected result

Should work?

Actual result

See above.

Environment

macOS

Run gatsby info --clipboard in your project directory and paste the output here.

Cannot, same error as above.

stale?

Most helpful comment

Check your version of Node.js and npm. I had this problem as well, updated to Node 10.16.0 and the issue went away.

All 10 comments

+1, also happening on linux environment as well gatsby build

[Container] 2019/07/23 00:39:39 Running command gatsby build 
/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/telemetry.js:306 
  async sendEvents() { 
        ^^^^^^^^^^ 
SyntaxError: Unexpected identifier 
    at Object.exports.runInThisContext (vm.js:76:16) 
    at Module._compile (module.js:545:28) 
    at Object.Module._extensions..js (module.js:582:10) 
    at Module.load (module.js:490:32) 
    at tryModuleLoad (module.js:449:12) 
    at Function.Module._load (module.js:441:3) 
    at Module.require (module.js:500:17) 
    at require (internal/module.js:20:19) 
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/gatsby-telemetry/lib/index.js:3:19) 
    at Module._compile (module.js:573:32) 

[Container] 2019/07/23 00:39:40 Command did not exit successfully gatsby build exit status 1 
[Container] 2019/07/23 00:39:40 Phase complete: BUILD State: FAILED 
[Container] 2019/07/23 00:39:40 Phase context status code: COMMAND_EXECUTION_ERROR Message: Error while executing command: gatsby build. Reason: exit status 1 

Looks like this breaking as far back as June 27 possibly the 2.7.3 version is broken.

Check your version of Node.js and npm. I had this problem as well, updated to Node 10.16.0 and the issue went away.

Thanks @timwellswa ... my codebuild image was pinned to an ancient version of npm.

what node version were you running?

I was running node version 6 - sorry, I don't remember the particular build. I am a contractor and had some projects tied to earlier versions. Hadn't even thought about the fact that I hadn't updated in awhile until I went to install gatsby.

+1 on Node v6.10.0. Here's a screencast: https://smb-infogroup-dpr.d.pr/gWfZj1

Upgraded to Node v10.16.0 and it worked as expected.

Hiya!

This issue has gone quiet. Spooky quiet. 馃懟

We get a lot of issues, so we currently close issues after 30 days of inactivity. It鈥檚 been at least 20 days since the last update here.

If we missed this issue or if you want to keep it open, please reply here. You can also add the label "not stale" to keep this issue open!

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contributefor more information about opening PRs, triaging issues, and contributing!

Thanks for being a part of the Gatsby community! 馃挭馃挏

Hey again!

It鈥檚 been 30 days since anything happened on this issue, so our friendly neighborhood robot (that鈥檚 me!) is going to close it.

Please keep in mind that I鈥檓 only a robot, so if I鈥檝e closed this issue in error, I鈥檓 HUMAN_EMOTION_SORRY. Please feel free to reopen this issue or create a new one if you need anything else.

As a friendly reminder: the best way to see this issue, or any other, fixed is to open a Pull Request. Check out gatsby.dev/contribute for more information about opening PRs, triaging issues, and contributing!

Thanks again for being part of the Gatsby community!

Node 6 doesn't natively support async operations anyway, Node 6 has reached End-of-life status the user should be inform to upgrade to supported node engine.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dustinhorton picture dustinhorton  路  3Comments

andykais picture andykais  路  3Comments

dustinhorton picture dustinhorton  路  3Comments

hobochild picture hobochild  路  3Comments

ghost picture ghost  路  3Comments