1
votes

Am facing a problem in React js ,when i installed bootstrap using npm , the project refused to run in the browser with npm start command.

I was following this React-Bootstrap link https://react-bootstrap.github.io/getting-started.html

So below is the error am getting:

sh: react-scripts: command not found npm ERR! file sh npm ERR! code ELIFECYCLE npm ERR! errno ENOENT npm ERR! syscall spawn npm ERR! [email protected] start: react-scripts start npm ERR! spawn ENOENT 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: npm ERR!
/Users/haleem/.npm/_logs/2017-10-17T12_58_51_812Z-debug.log

1
try npm cache clean and install the dependency again. - Arslan Tariq
Ok , is that the command - user7615935
I tried it but it gives me this npm ERR! As of npm@5, the npm cache self-heals from corruption issues and data extracted from the cache is guaranteed to be valid. If you want to make sure everything is consistent, use 'npm cache verify' instead. npm ERR! npm ERR! If you're sure you want to delete the entire cache, rerun this command with --force. npm ERR! A complete log of this run can be found in: npm ERR! /Users/haleem/.npm/_logs/2017-10-17T16_08_05_371Z-debug.log Haleems-MBP:food_app haleem$ - user7615935
You need to first run an npm install to install react-scripts from create-react-app. Have you done npm install --save create-react-app? - Chase DeAnda
Depends. Is it an existing project or new project. For new project do npm install --save create-react-app for existing project do npm install. - Chase DeAnda

1 Answers

2
votes

You need to install the packages before running it locally:

For new projects:

npm install --save create-react-app

For existing projects:

npm install