“NODE_ENV” is not recognized as an internal or external command

运行nodejs程序时出现NODE_ENV不是内部或外部命令,也不是可运行的程序,或者批处理文件

“NODE_ENV” is not recognized as an internal or external command, operable command or batch file

初始脚本:

 "scripts": {
    
    "start": "NODE_ENV=production PORT=3333cs pm2 start dist/index.js",
    
  }

解决办法:在NODE_ENV前面添加 set ,这样问题就被解决了

"scripts": {
    
    "start": "set NODE_ENV=production PORT=3333cs pm2 start dist/index.js",
    
  }


你可能感兴趣的:(nodejs)