首页 > 解决方案 > 节点以 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' 不是内部或外部命令、可运行程序或批处理文件。

标签: node.jsexpressnpm

解决方案


您可以只指向 nodemon 可执行文件...

node node_modules/nodemon/bin/nodemon.js bin/www

推荐阅读