【问题标题】:nodemon installed but not working on win10nodemon 已安装但无法在 win10 上运行
【发布时间】:2019-09-28 07:11:56
【问题描述】:

我已经安装了 nodemon(在本地、全局和作为开发依赖项中尝试过),我收到了 nodemon 已正确安装的消息:

+ nodemon@1.19.0
updated 1 package and audited 2357 packages in 24.027s
found 0 vulnerabilities

我的 package.json 文件如下所示:

{
  "name": "tests-node",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "author": "",
  "license": "ISC",
  "dependencies": {
    "express": "^4.16.4"
  },
  "devDependencies": {
    "nodemon": "^1.19.0"
  }
}

但是当我运行它时,我得到 nodemon 不存在的消息(消息是法语):

'nodemon' n’est pas reconnu en tant que commande interne
ou externe, un programme exécutable ou un fichier de commandes.

【问题讨论】:

    标签: nodemon


    【解决方案1】:

    我通常这样做:

    像这样更改 package.json 中的“脚本”:

     "scripts": {
        "start": "node server/index.js",
        "dev": "nodemon server/index.js"
      },
    

    然后用npm run dev 启动nodemon。

    npm run start 是普通节点服务器,dev 是 nodemon。

    【讨论】:

      猜你喜欢
      • 2019-04-15
      • 2023-03-23
      • 2018-07-31
      • 2020-04-09
      • 2017-12-09
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-10-21
      相关资源
      最近更新 更多