[英]How to add a new script in package.json
I want to add a script dev
in my package.json
.我想在我的
package.json
添加一个脚本dev
。
I tried adding it manually in a text editor, but when I run:我尝试在文本编辑器中手动添加它,但是当我运行时:
npm run dev
I get some errors.我得到一些错误。 Is it possible to add the script from the terminal?
是否可以从终端添加脚本?
Edit:编辑:
I added:我补充说:
"scripts:" {
"start": "node app",
"dev": "nodemon app"
}
and I got this error:我收到了这个错误:
nodemon app sh: nodemon: command not found npm ERR! code ELIFECYCLE npm ERR! syscall spawn npm ERR! file sh npm ERR! errno ENOENT npm ERR! code@1.0.0 dev: nodemon app npm ERR! spawn ENOENT npm ERR! npm ERR! Failed at the code@1.0.0 dev script.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.