Reputation: 709
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.
Upvotes: 0
Views: 2588
Reputation: 2108
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.
Upvotes: 4