node.js - 节点以 nodemon 开头
问题描述
使用 express 学习节点,已下载并正在研究结构模板,但忘记如何启动 nodemon 以便自动应用任何更新。我从获得模板的地方获得了命令,但丢失了位置,并且在准备好 npm、node 的一些命令之后......我无法想出 how2。谢谢
运行应用程序的 Currnet 命令是:
npm start
//package.json
{
"name": "eautoshop",
"version": "0.0.0",
"private": true,
"scripts": {
"start": "node ./bin/www",
"devstart": "nodemon ./bin/www"
},
"dependencies": {
"cookie-parser": "~1.4.4",
"debug": "~2.6.9",
"express": "~4.16.1",
"express-validator": "^6.2.0",
"http-errors": "~1.6.3",
"morgan": "~1.9.1",
"mysql": "^2.17.1",
"pug": "^2.0.4"
},
"devDependencies": {
"nodemon": "^1.19.4"
}
}
nodemon app
给出错误:
'nodemon' 不是内部或外部命令、可运行程序或批处理文件。
解决方案
您可以只指向 nodemon 可执行文件...
node node_modules/nodemon/bin/nodemon.js bin/www
推荐阅读
- angularjs - How can i pass extra parameter when color changed?
- javascript - JS使用扩展运算符克隆对象并更改一个字段
- batch-file - 尝试编写一个批处理文件,使用 FORFILES 删除旧的 xml 和 psr 数据文件,同时还计算以这种方式删除了多少文件
- uml - 如何通过代码创建 UML 图并在图中搜索字符?
- authentication - Nginx 在一台主机上具有多个客户端证书
- python - '在系列上使用字典进行聚合'的替代方法是什么
- sql - GroupBy 只有一个字段,不是我在 Select 中的所有字段
- postgresql - 为什么我不能在这里使用 IF ?
- reactjs - 从 React 组件创建 Html,包括样式
- vba - Checkbox Yes/No Change on Dropbox Change