I use SET NODE_ENV=PRODUCTION& nodemon server.js in my package.json file.
But the environment not change and still run in the development mode.
It also throw error like sh: 1: SET: not found in terminal.
CodePudding user response:
Set works only windows OS. If you used Unix like Operating systems you should just make NODE_ENV=production
CodePudding user response:
Since you're using sh
and terminal
, I'm guessing you're on either Mac or Linux, as most production servers are UNIX based. The correct command would be just NODE_ENV=PRODUCTION