0

I am trying to understand how to be able to set the NODE_ENV variable during my start script in node. I am using a windows machine and I have seen some answers about this for mac/linux but I cannot figure it out on windows (disclaimer: I am new to windows shell scripting).

Currently I have this:

"scripts": {
    "serve_dev": "set NODE_ENV=development && nodemon index.js",
},

Which does not work. I have also tried adding $env:NODE_ENV... and that did not work as well. Does someone know how I can do this?

Thanks in advance for any help!

NickLans
  • 67
  • 1
  • 11

1 Answers1

0

I have resolved this issue and it was due to the spaces. The correct implimentation is:

"scripts": {
    "serve_dev": "set NODE_ENV=development&&nodemon index.js",
},
NickLans
  • 67
  • 1
  • 11