77202/how-can-i-set-node-env-production-on-windows
In Ubuntu it's quite simple; I can run the application using:
$ NODE_ENV=production node myapp/app.js
However, this doesn't work on Windows. Is there a configuration file where I can set the attribute?
Hello @kartik,
It would be ideal if you could set parameters on the same line as your call to start Node.js on Windows. Look at the following and run it exactly as stated:
You have these two options:
At the command line:
set NODE_ENV=production&&npm start
or
set NODE_ENV=production&&node index.js
The trick for it to work on Windows is you need to remove the whitespace before and after the "&&". Configured your package.json file with start_windows (see below) below. Then Run "npm run start_windows" at the command line.
//package.json "scripts": { "start": "node index.js" "start_windows": "set NODE_ENV=production&&node index.js"
Hope it helps!!
Thank You!!
Hello @kartik, Try using: npm start --prefix path/to/your/app & inside ...READ MORE
Hello @kar You can do the following to ...READ MORE
Hello @kartik, You can use request, I just found ...READ MORE
Hello @kartik, Use: Device.updateMany({}, { cid: '' }); Hope it ...READ MORE
Hello, In the error callback or $.ajax you have three ...READ MORE
Hello @kartik, If your script is called myScript.js ...READ MORE
Hello @kartik, Try this code : // Create an ...READ MORE
Hello @kartik, Use node-inspector from any browser supporting WebSocket. Breakpoints, ...READ MORE
Hello @kartik, To update NPM, this worked for ...READ MORE
Hello @kartik, JSON.stringify's third parameter defines white-space insertion ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.