NODE_ENV=development : The term 'NODE_ENV=development' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again.
CodePudding user response:
Need win-node-env
module
npm install -g win-node-env
For Windows
SET NODE_ENV=development
node app.js
CodePudding user response:
For setting environment variables like that on Windows you can use package called cross-env.
You can install it by: npm install --save-dev cross-env
. And then you have almost exact example from their docs:
{
"scripts": {
"build": "cross-env NODE_ENV=production webpack --config build/webpack.config.js"
}
}