Gatsby: Gatsby CLI not working on NodeJS 8.0.0

Created on 5 Dec 2019  路  12Comments  路  Source: gatsbyjs/gatsby

Description

I can't run any gatsby-cli commands on NodeJS v8.0.0 (Windows 10). Due to some ES6 syntax.

Steps to reproduce

  1. Install NodeJS at 8.0.0 (E.g. using NVM)
  2. Install gastsby-cli globally
  3. Attempt to run ANY gatsby command. E.g. gatsby --help
  4. See the error

Actual result

gatsby --help
C:\ProgramData\nvm\v8.0.0\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> (C:\ProgramData\nvm\v8.0.0\node_modules\gatsby-cli\node_modules\gatsby-telemetry\lib\event-storage.js:17:21)

Environment

I can't run the command 馃檭. But here is some info about the environment:

OS: Windows 10 Pro 64 bit

node -v
v8.0.0

npm -v
5.0.0

npm ls -g gatsby-cli
C:\Program Files\nodejs
`-- [email protected]
cli bug

Most helpful comment

Hmmm. Maybe we should be supporting the LTS release of Node 8 rather than Node 8.0.0? The first LTS release was Node 8.9.0. I suspect a _lot_ of our dependencies won't work with Node 8.0.0.

I've opened a PR to check if our tests pass on Node 8.9.0: https://github.com/gatsbyjs/gatsby/pull/19973

Note that Node 8 will reach _End of Life_ status at the end of this month. But this issue is probably worth thinking about when we bump the minimum version up to Node 10.

All 12 comments

Try updating to the latest version of Node 8 as it seems the spread operator in object literals was not added in 8.0.0 but rather 8.3.0 as noted on MDN: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Spread_syntax

I'm not _actually_ trying to run a Gatsby site on Node 8. If I were, I'd definitely be using some later minor version of Node 8.

This issue is meant to point out that Gatsby will actually not work on a version that it is supposed to support. (The package.json files of all gatsby packages list >=8.0.0 as the NodeJS requirement.)

I have a Gatsby plugin. I need to make sure that my plugin works on all the same NodeJS versions as Gastsby does. For this reason, I decided to just downgrade to the earliest supported version -> 8.0.0.

Hmmm. Maybe we should be supporting the LTS release of Node 8 rather than Node 8.0.0? The first LTS release was Node 8.9.0. I suspect a _lot_ of our dependencies won't work with Node 8.0.0.

I've opened a PR to check if our tests pass on Node 8.9.0: https://github.com/gatsbyjs/gatsby/pull/19973

Note that Node 8 will reach _End of Life_ status at the end of this month. But this issue is probably worth thinking about when we bump the minimum version up to Node 10.

Sort of related (maybe). Perhaps there should be a doc explaining the strategy here. Gatsby is a big project, lots of packages. Also a lot of 3th party plugins.

The "get up and running" docs mention a set of system requirements, the NodeJS version number is there. You want to make sure every Gatsby plugin and package _actually_ works with those requirements. And to do that every plugin author needs to make sure their plugin follows the correct strategy.

As a plugin author I don't have anywhere to go right now. I personally do have some experience with babel so I can probably get this working鈥攂ut I have no doubt this will be a first for some people.

Note that Node 8 will reach End of Life status at the end of this month. But this issue is probably worth thinking about when we bump the minimum version up to Node 10.

Also not _really_ related to this issue, but my underlying problem -> I'll just focus on Node 10.0.0 right now.

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/contribute for more information about opening PRs, triaging issues, and contributing!

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

We're waiting for Node 10 I guess? 馃

Yup, we'll be bumping our minimum supported version to 10 LTS once we're back from holiday next week!

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/contribute for more information about opening PRs, triaging issues, and contributing!

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

@jessevdp we definitely need to do a better job at upgrading our dependencies. Node 8.6.0 seems to work for gatsby-cli (or use the --harmony flag in node 8.0.0). Sadly it seems like gatsby needs 8.10.0 to get things going.

We'll be more careful with the next deprecations of node. The next one will be 10 from there on we can do a better job on making sure things keep working. Node 8 has been a weird node version from a maintainer's point of view because packages do not always upgrade their engines when bumping their versions.

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/contribute for more information about opening PRs, triaging issues, and contributing!

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

Closing this issue as Node 8 support was dropped as of Gatsby 2.20.0. Update to at least Node 10.13.0 or higher.

Was this page helpful?
0 / 5 - 0 ratings