I am currently trying to use create-react-app which uses three different packages: react, react-scripts and react-dom. I have installed create-react-app and then when I change into the directory and hit npm start
I get a react-scripts: command not found
. I've ran into a lot of problems with this. I can see react-scripts
is in my node_modules
folder but I keep getting command not found
when trying to run npm start
. I tried to delete and re-install all of my node_modules
but it didn't work. Anyone else having this issue?
✘ ✝ Node/toDoApp/my-test master± npm start
> my-test@0.1.0 start /Users/jzilch/Desktop/Web
Projects/Node:Express/Node/toDoApp/my-test
> 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! my-test@0.1.0 start: `react-scripts start`
npm ERR! spawn ENOENT
npm ERR!
npm ERR! Failed at the my-test@0.1.0 start script.
npm ERR! This is probably not a problem with npm. There is likely
additional logging output above.
1.Delete node_modules, package-lock.json
command for deleting node_modules :
2.install react-scripts version 1.1.1
command for install react-scripts :
3.
npm install
4.now run server it will work fine.
Note : If you are a Linux user then don't forget to use sudo before npm
I use this in a dockerizer enviroment. I already install locally in node_modules using
package.json
.so, I added this:
That solved my confusing issue