Create-react-app: react-scripts start is giving error

Created on 30 Dec 2019  路  11Comments  路  Source: facebook/create-react-app

Describe the bug

"react-scripts start" is giving error .
It was working fine yesterday. From today it's getting failed.

react-scripts start

Unexpected token {
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.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:`

Error log

11 silly lifecycle [email protected]~start: Returned: code: 1 signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: react-scripts start
13 verbose stack Exit status 1
13 verbose stack at EventEmitter. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/index.js:332:16)
13 verbose stack at EventEmitter.emit (events.js:198:13)
13 verbose stack at ChildProcess. (/usr/local/lib/node_modules/npm/node_modules/npm-lifecycle/lib/spawn.js:55:14)
13 verbose stack at ChildProcess.emit (events.js:198:13)
13 verbose stack at maybeClose (internal/child_process.js:982:16)
13 verbose stack at Process.ChildProcess._handle.onexit (internal/child_process.js:259:5)

Did you try recovering your dependencies?

Yes .
i tried

rm-rf ./node_modules
npm cache clean -f
npm install
...all such combination

Have you done all these steps and still see the issue?
npm -v ===> 6.13.4
node -v ===> v10.17.0
os ===> mac
And also I tried to copy and use the package.json and package.lock.json and tried in my reop.
Even then it's the same.

Some dependency of react-scripts is badly fucked up.

Important observarion in create-react-app

1) react-scripts build works fine
2) When you clone the repo and do npm install the package.lock.json get updated.
Ideally that should not be the case as far as I know.

What all I searched

I searched all related threads (https://github.com/vuejs/vue-cli/issues/2596 ....) none worked for
me.

My submission would be some version of npm is fucked up because it gave me
unexpected token import with npm 5.0.1

my package.json
{
"name": "flexi",
"version": "1.0.0",
"description": "Flexi app",
"main": "index.js",
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"start-prod": "react-scripts build && node server.js",
"selenium-install": "selenium-standalone install",
"selenium-start": "selenium-standalone start",
"selenium-test": "wdio wdio.conf.js",
"selenium-test-dev": "wdio wdio.conf.dev.js"
},
"repository": {
"type": "git",
"url": "[email protected]:mohithg/flexi.git"
},
"keywords": [
"website"
],
"author": "Mohith G",
"license": "ISC",
"dependencies": {
"caniuse-lite": "1.0.30000974",
"classnames": "2.2.5",
"compute-iqr": "1.1.0",
"copy-to-clipboard": "3.0.8",
"express": "4.16.3",
"filepond-plugin-file-validate-type": "1.1.0",
"formsy-react": "1.1.4",
"griddle-react": "1.13.1",
"highcharts": "7.2.1",
"highcharts-react-official": "2.2.2",
"http-proxy-middleware": "0.20.0",
"json-format": "1.0.1",
"less": "3.10.3",
"lodash": "4.17.5",
"mixpanel": "0.11.0",
"mixpanel-browser": "2.29.1",
"moment": "2.22.2",
"moment-timezone": "0.5.21",
"moment-timezone-all": "0.5.5",
"normalize.css": "8.0.1",
"postcss-loader": "3.0.0",
"react": "16.3.2",
"react-awesome-query-builder": "0.2.52",
"react-collapsible": "2.2.0",
"react-dates": "17.1.0",
"react-dom": "16.3.2",
"react-filepond": "2.0.8",
"react-rangeslider": "2.2.0",
"react-router-dom": "4.2.2",
"react-scripts": "3.3.0",
"react-select": "3.0.8",
"react-spinners": "0.3.2",
"react-tabs": "2.2.2",
"react-times": "3.1.5",
"react-toastify": "4.1.0",
"react-tooltip": "3.6.1",
"recharts": "1.0.0-beta.10",
"socket.io-client": "2.1.1",
"store": "2.0.12",
"superagent": "3.8.3",
"superagent-promise": "1.1.0",
"tz": "0.1.1",
"wdio-helpers": "1.2.4",
"wdio-jasmine-framework": "0.3.5",
"wdio-screenshot": "0.6.0",
"webdriverio": "4.13.2"
},
"devDependencies": {
"@babel/core": "7.7.7",
"@babel/preset-env": "7.7.7",
"@babel/preset-react": "7.7.4",
"babel-loader": "8.0.6",
"babel-plugin-transform-class-properties": "6.24.1",
"babel-plugin-transform-es2015-modules-commonjs": "6.26.2",
"clean-webpack-plugin": "0.1.19",
"cross-env": "5.1.4",
"css-loader": "0.28.11",
"ejs-loader": "0.3.1",
"favicons-webpack-plugin": "0.0.9",
"file-loader": "1.1.11",
"html-webpack-plugin": "3.2.0",
"image-webpack-loader": "4.2.0",
"less-loader": "5.0.0",
"node-sass": "4.8.3",
"sass-loader": "7.0.1",
"selenium-standalone": "6.15.1",
"style-loader": "0.20.3",
"url-loader": "1.0.1",
"wdio-docker-service": "1.3.0"
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
}
}

bug report needs triage stale

Most helpful comment

Having the same problem !!!

Try cmd:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It worked for me !!!
Hope your problem would be _resolved_ by it

All 11 comments

Having same problem on a clean vue-cli install

Solved, reinstall newest version of node.js

uninstall node js ,nmp install and rm package-lock.json

Having the same problem !!!

Try cmd:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It worked for me !!!
Hope your problem would be _resolved_ by it

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

Having the same problem !!!

Try cmd:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It worked for me !!!
Hope your problem would be _resolved_ by it

thankyou, You also very help me!!!!

Having the same problem !!!

Try cmd:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It worked for me !!!
Hope your problem would be _resolved_ by it

thanks it was my problem and solved by it

Having the same problem !!!

Try cmd:

echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf && sudo sysctl -p

It worked for me !!!
Hope your problem would be _resolved_ by it

Can you explain more about the error, thank you helped me.

I am also facing the same issue. It was working yesterday but not today.

This issue has been automatically marked as stale because it has not had any recent activity. It will be closed in 5 days if no further activity occurs.

This issue has been automatically closed because it has not had any recent activity. If you have a question or comment, please open a new issue.

Was this page helpful?
0 / 5 - 0 ratings