nodemon使用报错restarting due to changes...建议改用supervisor

1 篇文章 0 订阅
1 篇文章 0 订阅

困扰了我两天了的一个问题,下面是我的使用过的方法

1.重启(没啥用)

2.重装nodemon,再删掉之后全局安装和本地安装

3.重装node

4.添加系统环境变量详见(https://blog.csdn.net/Vrainy/article/details/107268357)

这个没解决我的问题,但是说不定能解决你的问题

5.安装supervisor

说回报错原因,其实到现在我都不知道,可能是nrn或者是Gulp的原因。但是只是可能,毕竟我也做了一点别的事情。

总之,难以解决,又不想浪费太多时间,毕竟这个错误有点不知所措…

安装supervisor过程和nodemon差不太多

1.npm install -g supervisor

2.supervisor app.js

这是nodemon的报错

[nodemon] restarting due to changes...
(node:19504) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=3056) get ProcessId 2> nul
    at checkExecSyncError (child_process.js:643:11)
    at execSync (child_process.js:679:15)
    at kill (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\run.js:345:26)
    at Function.run.kill (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\run.js:437:7)
    at Bus.<anonymous> (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\run.js:507:7)
    at Bus.emit (events.js:387:35)
    at restartBus (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\watch.js:228:7)
    at FSWatcher.filterAndRestart (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\lib\monitor\watch.js:212:16)
    at FSWatcher.emit (events.js:375:28)
    at FSWatcher.emitWithAll (C:\Users\Devil\AppData\Roaming\npm\node_modules\nodemon\node_modules\chokidar\index.js:540:8)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:19504) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:19504) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate 
the Node.js process with a non-zero exit code.

这是supervisor的执行结果,亲测好用,建议新手遇到nodemon的上述错误不要过分纠结,先使用这个进行替代,毕竟组建的更迭或者是更深的问题新手总之有些乏力,反而会影响继续的学习热情,所以建议先使用supervisor。在这里插入图片描述

  • 10
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值