1

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

10
  • try npm cache clean and install the dependency again. Commented Oct 17, 2017 at 13:30
  • Ok , is that the command Commented Oct 17, 2017 at 16:05
  • 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$ Commented Oct 17, 2017 at 16:08
  • 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? Commented Oct 17, 2017 at 16:10
  • 1
    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. Commented Oct 17, 2017 at 16:16

2 Answers 2

2

You need to install the packages before running it locally:

For new projects:

npm install --save create-react-app

For existing projects:

npm install
Sign up to request clarification or add additional context in comments.

1 Comment

This is strange, i created a new react app, and ran it, server started well, and showed default app.js content on webpage. then i added bootstrap using npm install bootstrap after getting this installed, again did npm start, this time it started giving errors. Again had to do npm install to install needed dependencies. Not i am not understanding, were some (already installed) dependencies removed automatically when i installed bootstrap, or bootstap required some addition dependencies to be installed?
0

Problem : downloaded react-bootstrap in React.js and begun having problems. The project had 'npm start' command error, with another issue below.

'react-scripts' is not recognized as an internal or external command, operable program or batch file.

even 'npm cache clean' command failed, and 'npm install' also failed.

Solution : npm install -g [email protected]

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.