I'm trying to run a react project . and after I run command : npm start , it gave me an error:
sh: SET: command not found
npm ERR! file sh
npm ERR! code ELIFECYCLE
npm ERR! errno ENOENT
npm ERR! syscall spawn
npm ERR! [email protected] start: `SET PORT=3100 && node scripts/start.js`
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/jzhu321/.npm/_logs/2019-04-22T09_29_51_770Z-debug.log
and I have found the config here in package.json
:
"scripts": {
"start": "SET PORT=3100 && node scripts/start.js",
"build": "node scripts/build.js",
"test": "node scripts/test.js"
},
How do I fix this problem?
On Windows, you may face the “npm command not found” error if the path to nodejs and npm are not added to your path variable. To fix this, locate the path to nodejs and npm binaries. The command above should add the specified directory to the path variable.
Shell script doesnot have SET
command, just had: set
it should be :
"start": "set PORT=3100 && node scripts/start.js",
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With