我正在youtube上关注本教程,因为我正在尝试学习node.js / express。
我在package.json文件中更改了以下内容,以便能够使用nodemon。
package.json
"scripts": {
"start": "if [[ $NODE_ENV == 'production' ]]; then node ./bin/www; else nodemon ./bin/www; fi"
},
但是,当我在cmd提示符下运行以下命令时,出现错误。
set DEBUG=myapp:* & npm start
以下错误:
$NODE_ENV was unexpected at this time.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! myapp@0.0.0 start: `if [[ $NODE_ENV == 'production' ]]; then node ./bin/www; else nodemon ./bin/www; fi`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the myapp@0.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
- 我已经尝试过更新所有npm模块。 -我曾尝试删除package-lock.json并重新安装所有内容。
我似乎无法弄清楚。