提问者:小点点

在nodejs中使用npm启动的问题。 “nodemon”未被识别为内部或外部命令,可操作程序或批处理文件


我在Ubuntu中创建了一个项目,我运行并部署了它,它工作得很好。

现在,我更改了操作系统并使用windows 10,当我在vscode中运行此代码npm start时,它会显示以下错误:

> Store@1.0.0 start F:\Projects\Nodejs\Store
> nodemon server.js

'nodemon' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! Store@1.0.0 start: `nodemon server.js`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the Store@1.0.0 start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\programmer\AppData\Roaming\npm-cache\_logs\2020-06-27T11_34_26_614Z-debug.log

我安装了nodemon:

    {
  "name": "Store",
  "version": "1.0.0",
  "description": "",
  "main": "server.js",
  "scripts": {
    "start": "nodemon server.js"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "nodemon": "^2.0.4"
  }
}

并在windows中下载和安装NodeJ。

有什么问题? 我怎样才能解决这个问题??


共1个答案

匿名用户

我来解决问题。 我删除了所有node_module,并使用npm install命令再次安装。