node 使用nodemon 报错 UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=4388) get ProcessId 2> nul
at checkExecSyncError (child_process.js:760:11)
at execSync (child_process.js:833:15)
at kill (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_nodemon@2.0.12@nodemon\lib\monitor\run.js:345:26)
at Function.run.kill (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_nodemon@2.0.12@nodemon\lib\monitor\run.js:437:7)
at Bus. (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_nodemon@2.0.12@nodemon\lib\monitor\run.js:507:7)
at Bus.emit (events.js:412:35)
at restartBus (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_nodemon@2.0.12@nodemon\lib\monitor\watch.js:228:7)
at FSWatcher.filterAndRestart (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_nodemon@2.0.12@nodemon\lib\monitor\watch.js:212:16)
at FSWatcher.emit (events.js:400:28)
at FSWatcher.emitWithAll (C:\Users\Glasssix-SH\Desktop\koa2\node_modules_chokidar@3.5.2@chokidar\index.js:540:8)
(node:10132) 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: 5)
一直以为是没有添加catch 结果在一个网站上看到
npm uninstall nodemon npm install nodemon@2.0.7 --save-dev
有可能是nodemon的版本问题
原文链接:https://stackoverflow.com/questions/68250987/command-failed-wmic-process-after-updating-npm-in-express-app
UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=4388) g
最新推荐文章于 2023-08-08 09:18:50 发布