I am developing in node.js and wanted to take into account both production and development environment. I found out that setting NODE_ENV while running the node.js server do
I can suggest cross platform sollution. It's done with the help of the cross-env npm package. Your script section would look like this:
"scripts": {
"globals" : "npm i -g cross-env",
"start": "cross-env NODE_ENV=development & node ./bin/server",
"qa2": "cross-env NODE_ENV=qa2 & node ./bin/server",
"prod": "cross-env NODE_ENV=production & node ./bin/server"
}
So you run once:
npm run globals // to install global dependencies
Then you're free to use your scripts both on linux and windows(mac?).