I pull down a project that I haven’t tested it for two months.
I remove the
node_modules folder and try
npm install. But it shows me error again.
> email@example.com start /Users/apple/SourceTree/asus_chat > react-scripts start sh: react-scripts: command not found npm ERR! Darwin 14.5.0 npm ERR! argv "/usr/local/bin/node" "/usr/local/bin/npm" "start" npm ERR! node v6.11.2 npm ERR! npm v3.10.10 npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! firstname.lastname@example.org start: `react-scripts start` npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the email@example.com start script 'react-scripts start'. npm ERR! Make sure you have the latest version of node.js and npm installed. npm ERR! If you do, this is most likely a problem with the asus-chat package, npm ERR! not with npm itself. npm ERR! Tell the author that this fails on your system: npm ERR! react-scripts start npm ERR! You can get information on how to open an issue for this project with: npm ERR! npm bugs asus-chat npm ERR! Or if that isn't available, you can get their info via: npm ERR! npm owner ls asus-chat npm ERR! There is likely additional logging output above. npm ERR! Please include the following file with any support request: npm ERR! /Users/apple/SourceTree/asus_chat/npm-debug.log
- node 6.11.2
- npm 3.10.10
- react 15.5.4
- react-dom 15.5.4
- react-scripts 1.0.3
According to the author of Create React App:
- We absolutely should not be installing react-scripts globally.
- And we also don’t need ./node_modules/react-scripts/bin/ in package.json as this answer implies.
Something went wrong when dependencies were installed the first time.
The author suggest doing these three steps:
npm install -g npm@latestto update npm because it is sometimes buggy.
rm -rf node_modulesto remove the existing modules.
npm installto re-install the project dependencies.