Create-react-app: Can't `npm start` new app, SyntaxError: Unexpected token => on a fresh install

Created on 22 Jul 2016  路  10Comments  路  Source: facebook/create-react-app

Edit from maintainers: the project requires Node >= 4.0.
We鈥檒l fix the CLI to report an error in earlier versions.


I can't get the local server started. My steps to the error:

  • npm install -g create-react-app
  • create-react-app hello
  • No errors creating the app
  • cd hello
  • npm start
> [email protected] start /Users/olivier/Sites/sandbox/hello
> react-scripts start

/Users/olivier/Sites/sandbox/hello/node_modules/react-scripts/scripts/start.js:23
var isSmokeTest = process.argv.some(arg =>
                                        ^^
SyntaxError: Unexpected token =>
    at exports.runInThisContext (vm.js:73:16)
    at Module._compile (module.js:443:25)
    at Object.Module._extensions..js (module.js:478:10)
    at Module.load (module.js:355:32)
    at Function.Module._load (module.js:310:12)
    at Function.Module.runMain (module.js:501:10)
    at startup (node.js:129:16)
    at node.js:814:3

Using npm v3.10.5 on OS X 10.11.6

bug

Most helpful comment

@olivier-w This requires node >= 4 in order to run since it was uses arrow functions etc...

All 10 comments

@olivier-w what node version are you using?

@conorhastings v0.12.7. Is there a recommended npm/node version that I should be using?

@olivier-w This requires node >= 4 in order to run since it was uses arrow functions etc...

@conorhastings Working with node v4.4.7 installed. Thank you!

Hmm wasn't CLI supposed to check for the Node version before installing?
Let's reopen for now to investigate.

@gaearon looks like it isn't called anywhere https://github.com/facebookincubator/create-react-app/blob/master/global-cli/index.js#L139-Lundefined

edit: @keyanzhang mentioned that in https://github.com/facebookincubator/create-react-app/pull/68#issue-166949749

I also maybe missing something but i don't see an engines if i npm install react-scripts

Ah, good points. Want to fix this? 馃槃

I think I just hit this bug. I know this was integrated but has the template been updated? Hate to ask, but I'm just getting my started with this (Coming from Ruby/HTML/SCSS)

Currently on Node 6.7.0 and npm 3.10.7.

If you have Node 6 you can't have this issue. Please file a new issue describing your problem in detail. Thanks!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

alleroux picture alleroux  路  3Comments

jnachtigall picture jnachtigall  路  3Comments

fson picture fson  路  3Comments

JimmyLv picture JimmyLv  路  3Comments

alleroux picture alleroux  路  3Comments