0
  "scripts": {
    "start": "$env:NODE_ENV=\"development\"; nodemon server.js",
    "start:prod": "$env:NODE_ENV=\"production\"; nodemon server.js"
  },

I want to set the NODE_ENV variable to development when i run 'start' script and to production when i run 'start:prod' script but i get error that says:

$env:NODE__ENV="development"; nodemon server.js The filename, directory name, or volume label syntax is incorrect. Error image

  • perhaps this questions will provide some inspiration for your solution: https://stackoverflow.com/questions/25112510/how-to-set-environment-variables-from-within-package-json – Brettski Nov 18 '22 at 03:34
  • The error suggests that it is `cmd.exe` rather than PowerShell that is trying to execute the commands. – mklement0 Nov 18 '22 at 04:17

0 Answers0