Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sh: SET: command not found in `npm start`

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?

like image 935
Neko Avatar asked Apr 22 '19 09:04

Neko


People also ask

Why my npm command is not working?

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.


1 Answers

Shell script doesnot have SET command, just had: set

it should be :

"start": "set PORT=3100 && node scripts/start.js",
like image 54
Thanh Nguyen Van Avatar answered Oct 04 '22 08:10

Thanh Nguyen Van