简体   繁体   English

无法安装和运行 nodemon npm - Nodejs

[英]unable to install and run nodemon npm - Nodejs

i am unable to run my nodejs project, getting the below error.我无法运行我的 nodejs 项目,出现以下错误。

> restfullnodejs@1.0.0 start C:\Users\PC\restfullnodejs
> nodemon app.js

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! file C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! path C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! restfullnodejs@1.0.0 start: `nodemon app.js`
npm ERR! spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the restfullnodejs@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\PC\AppData\Roaming\npm-cache\_logs\2020-07-01T13_04_14_121Z-debug.log

My guess is the error with nodemon, if so how do i resolve this issue.我的猜测是 nodemon 的错误,如果是这样,我该如何解决这个问题。 Unable to install nodemon too也无法安装nodemon

Update After deleting package-lock.json file and nodemodules folder tried npm clear cache --force then npm install - g nodemon更新删除 package-lock.json 文件和 nodemodules 文件夹后尝试npm clear cache --force then npm install - g nodemon

then getting below error然后低于错误

npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@~2.1.2 (node_modules\nodemon\node_modules\chokidar\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.3: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! syscall spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! file C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! path C:\Users\PC\restfullnodejs\git\bin\bash.exe
npm ERR! errno ENOENT
npm ERR! nodemon@2.0.4 postinstall: `node bin/postinstall || exit 0`
npm ERR! spawn C:\Users\PC\restfullnodejs\git\bin\bash.exe ENOENT
npm ERR!
npm ERR! Failed at the nodemon@2.0.4 postinstall 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\PC\AppData\Roaming\npm-cache\_logs\2020-07-01T14_10_55_492Z-debug.log

This is a common issue on PC/Windows;这是 PC/Windows 上的常见问题;

Try:尝试:

  1. Deleting the package-lock.json, and node_modules folder.删除 package-lock.json 和 node_modules 文件夹。
  2. Run 'npm install' from the root folder for your app.从您的应用程序的根文件夹运行“npm install”。
  3. Run 'npm install -g nodemon'运行'npm install -g nodemon'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM