Create-react-app: Syntax Error in react-scripts/scripts/start.js

Created on 20 Jul 2017  ·  3Comments  ·  Source: facebook/create-react-app

Is this a bug report?

Yes

Can you also reproduce the problem with npm 4.x?

Yes

Which terms did you search for in User Guide?

react-scripts syntax error

(Write your answer here if relevant.)

Environment

  1. node -v: v4.7.3
  2. npm -v: 5.3.0
  3. yarn --version (if you use Yarn):
  4. npm ls react-scripts (if you haven’t ejected): [email protected] /home/ubuntu/workspace/my-app
    └── [email protected]

Then, specify:

  1. Operating system: Cloud9 (c9.io) (Linux)
  2. Browser and version (if relevant): Chrome Version 59.0.3071.115

Steps to Reproduce

  1. Used create-react-app in Cloud9 using these instructions: https://community.c9.io/t/how-to-setup-react-app/16915
  2. Worked on app for a while; worked fine.
  3. Next day ran npm start in my my-app dir
  4. Got error below.

Expected Behavior

Code would compile and app would run

Actual Behavior

> [email protected] start /home/ubuntu/workspace/my-app

> react-scripts start

/home/ubuntu/workspace/my-app/node_modules/react-scripts/scripts/start.js:33

const {

  ^



SyntaxError: Unexpected token {

at exports.runInThisContext (vm.js:53:16)

at Module._compile (module.js:373:25)

at Object.Module._extensions..js (module.js:416:10)

at Module.load (module.js:343:32)

at Function.Module._load (module.js:300:12)

at Function.Module.runMain (module.js:441:10)

at startup (node.js:139:18)

at node.js:990:3

npm ERR! code ELIFECYCLE

npm ERR! errno 1

npm ERR! [email protected] start: `react-scripts start`

npm ERR! Exit status 1

npm ERR! 

npm ERR! Failed at the [email protected] start script.

Most helpful comment

Are you 100% sure Node version is 5.3.0 and not some older Node?

All 3 comments

Are you 100% sure Node version is 5.3.0 and not some older Node?

npm -v shows "5.3.0". I had gone down to 4.6.1 to confirm that the problem could be reproduced with npm 4.x. But updated back to 5.3.0. Getting same error with both versions.

node -v shows "v4.7.3"

Sorry, I got confused 😞

As per installation:

You’ll need to have Node >= 6 on your machine.

Node 4 or 5 won’t work. Please update to Node 6.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

DaveLindberg picture DaveLindberg  ·  3Comments

AlexeyRyashencev picture AlexeyRyashencev  ·  3Comments

adrice727 picture adrice727  ·  3Comments

stopachka picture stopachka  ·  3Comments

ap13p picture ap13p  ·  3Comments