0

So I'm trying to learn React. Never used it before today, taking a few courses. I was following along on the instructions at reactjs.org for setting up a single page application. I got all the way to running npm start and got hit with an error. So, annoyed, I did some research, updated npm and node.js (npm is now v5.6.0 and node is now 9.4.0) and still got the same error. Now I'm not finding any answers and totally lost as to why npm start doesn't work.

Jonathans-MBP:src jonathankuhl$ npm start

> [email protected] start /Users/jonathankuhl/Documents/HTML:CSS Practice/react test/my-app
> react-scripts start

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/jonathankuhl/.npm/_logs/2018-01-26T19_59_09_179Z-debug.log
Jonathans-MBP:src jonathankuhl$ cd ./
Jonathans-MBP:src jonathankuhl$ ls
App.css             index.js
App.js              logo.svg
App.test.js         registerServiceWorker.js
index.css
Jonathans-MBP:src jonathankuhl$ cd ..
Jonathans-MBP:my-app jonathankuhl$ ls
README.md       package-lock.json   public
node_modules        package.json        src
Jonathans-MBP:my-app jonathankuhl$ 

Any help would be appreciated.

2
  • wait, are you trying to run npm start in the src directory? Try it again from the my-app directory. Commented Jan 26, 2018 at 20:33
  • I was in my-app, that didn't work, so I tried in src. Like I said, first time doing this. Commented Jan 26, 2018 at 21:27

1 Answer 1

4

It looks like you don't have react-script installed, do npm install before npm start or if that doesn't fix it, do npm install react-scripts --save to install them and it should fix it.

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

Comments

Your Answer

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

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.