Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Every cli command fail after brand new installation #4072

Closed
Nottt opened this issue Feb 16, 2018 · 8 comments
Closed

Every cli command fail after brand new installation #4072

Nottt opened this issue Feb 16, 2018 · 8 comments

Comments

@Nottt
Copy link

Nottt commented Feb 16, 2018

Description

npm install --global gatsby-cli

Environment

Gatsby version: Unable to tell since I can't run any gatsby command
Node.js version: v4.2.6
Operating System: Ubuntu 16.04 Desktop

Actual result

root@vm:~# gatsby new
/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/reporters/console/console-reporter.js:111
      cols[i] = Math.max(...widths);
                         ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at _load_consoleReporter (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:6:52)
    at createReporter (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:19:45)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:33:18)

root@vm:~# gatsby new gatsby-site
/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/reporters/console/console-reporter.js:111
      cols[i] = Math.max(...widths);
                         ^^^

SyntaxError: Unexpected token ...
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:374:25)
    at Object.Module._extensions..js (module.js:417:10)
    at Module.load (module.js:344:32)
    at Function.Module._load (module.js:301:12)
    at Module.require (module.js:354:17)
    at require (internal/module.js:12:17)
    at _load_consoleReporter (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:6:52)
    at createReporter (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:19:45)
    at Object.<anonymous> (/usr/local/lib/node_modules/gatsby-cli/node_modules/yurnalist/dist/index.js:33:18)

Expected behavior

Based on docs, I expected to exit fine and display something on my local port 8000?

Steps to reproduce

1. npm install --global gatsby-cli

2. gatsby new or gatsby new gatsby-site

3.

...

@KyleAMathews
Copy link
Contributor

Try upgrading to node 6. We don't support node 4 (in practice I guess) any more.

@KyleAMathews
Copy link
Contributor

Or better, node 8

@nickmccurdy
Copy link
Contributor

nickmccurdy commented Feb 16, 2018

6 should be fine, it's the first LTS that supports object spread. Also, you can get the Gatsby version with npm ls gatsby.

@Nottt
Copy link
Author

Nottt commented Feb 16, 2018 via email

@nickmccurdy
Copy link
Contributor

It depends on the distribution, unfortunately Debian and Ubuntu based distributions tend to have fairly out of date packages. You can use node --version to see what you have installed, and if your distribution doesn't offer a more recent version of Node, I recommend https://github.com/creationix/nvm.

@spences10
Copy link
Contributor

spences10 commented Mar 25, 2018

Yes @nickmccurdy I haven't looked on Debian (what I'm using now) but I know the apt get version of node on Ubuntu is node legacy ~v4

I use n now you can install via n-install I tried using the official install but always had permission errors and using nvm slowed my bash shell down noticeably.

I made a guide as I was always starting from scratch on WSL due to either nvm slowing bash or not having the correct permissions in npm

@m-allanson
Copy link
Contributor

Closing as I think this is resolved.

@HaraldMuehlhoffCC
Copy link
Contributor

Got this error using Node.js v7.6.0 on Windows 10. Disappeared after I went to v10.16.3 LTS. So first Gatsby experience was an obscure SyntaxError. Maybe some initial health check could be added including friendlier messages?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
6 participants