I have a npm start script like this:
"start": "NODE_ENV=development PORT=3003 nodemon app.js",
but when I run it I get the following output:
'NODE_ENV' is not recognized as an internal or external command,
I am using vscode with powershell, anyone know why this doesn't work?
Use
SET NODE_ENV=development
PORT=3003
nodemon app.js
for windows. The one you tried works for Linux
This command works fine on linux, but windows does not recognize the NODE_ENV command. to fix this install this package globally:
npm install -g win-node-env
see win-node-env
This command works fine in linux, for windows use:-
"start": "set NODE_ENV=development&&PORT=3003&&nodemon app.js"
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.