今天安装一个github上的项目,当我npm start的时候,报错:
'NODE_ENV' 不是内部或外部命令,也不是可运行的程序
或批处理文件。
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! douban_api_server@1.0.0 start: `NODE_ENV=development node app.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the douban_api_server@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache\_logs\2020-05-21T06_51_15_707Z-debug.log
程序目录:
解决方法:
修改package.json文件:
修改:
"scripts": {
"start": "NODE_ENV=development node app.js",
"build": "NODE_ENV=production node app.js"
},
为:
"scripts": {
"start": "set NODE_ENV=development&&node app.js",
"build": "set NODE_ENV=production&&node app.js"
},
再次运行npm start就成功了。