Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

upon updating to 2.0.9^ Unhandled promise rejection warning on save while running nodemon. #1875

Closed
0neMiss opened this issue Jun 30, 2021 · 64 comments

Comments

@0neMiss
Copy link

0neMiss commented Jun 30, 2021

  • nodemon -2.0.9:
  • node -12.16.3:
  • OS : Windows 10
  • terminal: gitbash and also in vscode terminal(poweshell)
  • Not using docker
  • This happens when I run "server": "cross-env NODE_ENV=development nodemon index.js", this script.

Expected behaviour

I expect nodemon to restart and track my changes.

Actual behaviour

nodemon throws an unhandled promise rejection warning on save.

image

I updated to 2.0.9 because of the closing response on issue #1854

Now nodemon still fails to restart, but it does so with this new unhandled promise rejection.

I tried a few different methods of updating nodemon like npm install nodemon@latest and npm update nodemon. And also tried uninstalling it completely both locally and globally. Then reinstalling

I will also make a note that the unhandled promise rejection occurs on nodemon versions 2.0.8-alpha.a and up.

When I downgrade to 2.0.7 it silently fails to restart still.

image

Steps to reproduce

I'm on windows 10,
My package.json looks like this

{
  "name": "new",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "server": "cross-env NODE_ENV=development nodemon index.js",
    "client": "npm run start --prefix client",
    "dev": "concurrently \"npm run server\" \"npm run client\"",
    "start": "node index.js",
    "migrate": "knex migrate:rollback && knex migrate:latest && knex seed:run",
    "heroku-postbuild": "NPM_CONFIG_PRODUCTION=false npm install --prefix client && npm run build --prefix client"
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "dependencies": {
    "aws-sdk": "^2.886.0",
    "bcrypt": "^5.0.1",
    "cross-env": "^7.0.3",
    "dotenv": "^8.2.0",
    "express": "^4.17.1",
    "express-jwt": "^6.0.0",
    "express-session": "^1.17.1",
    "jsonwebtoken": "^8.5.1",
    "knex": "^0.95.4",
    "knexnest": "^1.0.0",
    "moment": "^2.29.1",
    "moment-timezone": "^0.5.33",
    "mongoose": "^5.12.2",
    "morgan": "^1.10.0",
    "multer": "^1.4.2",
    "passport": "^0.4.1",
    "passport-facebook": "^3.0.0",
    "passport-google-oauth20": "^2.0.0",
    "passport-jwt": "^4.0.0",
    "passport-linkedin-oauth2": "^2.0.0",
    "passport-local": "^1.0.0",
    "path": "^0.12.7",
    "pg": "^8.6.0",
    "react-icons": "^4.2.0",
    "stripe": "^8.140.0",
    "universal-cookie": "^4.0.4",
    "uuid": "^8.3.2"
  },
  "devDependencies": {
    "concurrently": "^6.0.0",
    "nodemon": "^2.0.9"
  }
}



results from --dump

--------------
node: v12.16.3
nodemon: 2.0.7
command: C:\Program Files\nodejs\node.exe C:\Users\unomi\OneDrive\Desktop\workwip_deployed\web-workwip\node_modules\nodemon\bin\nodemon.js --dump index.js
cwd: C:\Users\unomi\OneDrive\Desktop\workwip_deployed\web-workwip
OS: win32 x64
--------------
{
  run: false,
  system: {
    cwd: 'C:\\Users\\unomi\\OneDrive\\Desktop\\workwip_deployed\\web-workwip'
  },
  required: false,
  dirs: [
    'C:\\Users\\unomi\\OneDrive\\Desktop\\workwip_deployed\\web-workwip'
  ],
  timeout: 1000,
  options: {
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    runOnChangeOnly: false,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'index.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'index.js' ] },
    string: 'node index.js'
  }
}
--------------

@joshuasorkin
Copy link

joshuasorkin commented Jul 1, 2021

I have the same problem of an unhandled exception when I save on Windows 10, nodemon 2.0.9, node 14.16.1.

(node:13604) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=13880) get ProcessId 2> nul

@remy
Copy link
Owner

remy commented Jul 1, 2021

@0neMiss ignoring the promise exception for a moment, does nodemon behave as you'd expect otherwise?

@0neMiss
Copy link
Author

0neMiss commented Jul 1, 2021

@remy no, sorry if that was unclear. It doesn't restart nodemon on save, unless there is a compiling error, then it will actually restart with the changes. Otherwise it will throw this error and not restart with changes. I edited my comment above but ill mention it here too, the promise rejection warning begins to happen on 2.0.8-alpha.a and higher. I also checked versions from 2.0.7 to 1.19.4 and nodemon fails to restart on save on those versions as well but with no error.

@remy
Copy link
Owner

remy commented Jul 2, 2021

Can you install npm i -g nodemon@debug and try with this version and let me know the outcome?

@SmitBhamwala
Copy link

Can you install npm i -g nodemon@debug and try with this version and let me know the outcome?

I tried this but the error is still there.
Now, I have installed 2.0.7 version and its working fine for me.

@remy
Copy link
Owner

remy commented Jul 2, 2021

@SmitBhamwala you still see an unhandled exception? Can you paste what you're seeing (and paste the result of nodemon --version too)?

I can't resolve this without other people testing - the feature was added via a user PR and I in the version of Windows I have to test with everything was fine - so looking to you folk to cross check with me.

@SmitBhamwala
Copy link

SmitBhamwala commented Jul 2, 2021

@SmitBhamwala you still see an unhandled exception? Can you paste what you're seeing (and paste the result of nodemon --version too)?

I can't resolve this without other people testing - the feature was added via a user PR and I in the version of Windows I have to test with everything was fine - so looking to you folk to cross check with me.

Sending you this screenshot with version and error.
After saving, it shows this error.

error

@remy
Copy link
Owner

remy commented Jul 2, 2021

@SmitBhamwala okay, as per my post before yours, you'll need to update to the debug build via npm install -g nodemon@debug - this is the fix we're testing.

@SmitBhamwala
Copy link

@remy I already tried that debug build too but still error is there

err

er

@remy
Copy link
Owner

remy commented Jul 2, 2021

That is weird. The execSync that you can see in the output is actually wrapped in a try/catch in that debug build so something extra odd is happening.

Can you share the program you're using to run nodemon (ie. Is it command prompt, powershell, etc and any version numbers too) - I'll try to replicate this weekend

@SmitBhamwala
Copy link

SmitBhamwala commented Jul 3, 2021

@remy I am using Git Bash on Hyper Terminal (Version 3.0.2) and I also tried Git Bash on Microsoft VS code's inbuilt terminal (VS Code version 1.57.1)
I got same error on both terminals.

OS: Windows 8.1 Pro
Git version: 2.32.0
Node: 14.17.1
ExpressJS: 4.17.1

@0neMiss
Copy link
Author

0neMiss commented Jul 4, 2021

@remy
It is still happening on my end as well
image

I am also using Git Bash I also tried VS code's built in terminal using powershell as well no luck.

I also tried using yarn instead of npm and still no luck.

image

Git version: 2.24.0.windows.2
Powershell version: 5.1.19041.1023
nodemon version: 2.0.10-alpha.1
node version: 12.16.3
npm version: 7.12.0
OS: Windows 10 Home

Let me know if you need anything else!

@indranil786
Copy link

Hey @remy , I tried with the debug build, it is still showing me the error.

alpha

I have tried it with PowerShell and Gitbash both, but the error is still comming.

@remy
Copy link
Owner

remy commented Jul 7, 2021

I'm having trouble replicating.

This is my environment:

  • node@14
  • nodemon@debug (I've just pushed a new tweak) - 2.0.10-alpha.2
  • Windows 10 home, version 20H2
  • Tested both command prompt and powershell

Screenshots included:

Screenshot 2021-07-07 at 11 52 02

Screenshot 2021-07-07 at 11 48 32

Screenshot 2021-07-07 at 11 48 13

@0neMiss
Copy link
Author

0neMiss commented Jul 7, 2021

Thanks for trying, still no fix for me. I'll try a fresh install of windows or restoring back to an image when I get a chance.

@indranil786
Copy link

I tried the 2.0.10-alpha2 but it is still showing me the same error.

@remy
Copy link
Owner

remy commented Jul 7, 2021

I need more details - @indranil786 can you provide as much detail as I provided in my screenshot post?

@remy
Copy link
Owner

remy commented Jul 7, 2021

Bit more context: the throwing shouldn't be happening because the call is being wrapped in a try/catch, so this tells me, if others are still seeing the error, that there's some exception in the system combination - and the problem with Windows setup is that there's so many combinations. Hence why I need as much information about setup and versions as possible.

@0neMiss
Copy link
Author

0neMiss commented Jul 7, 2021

How do you run nodemon with the debug information you show here?
image

@remy
Copy link
Owner

remy commented Jul 8, 2021

It's not necessary, but I ran with the env value DEBUG=nodemon,nodemon:* - but I had to Google how to set the env in powershell as I didn't know

@remy
Copy link
Owner

remy commented Jul 8, 2021

I've pushed the latest fixes to nodemon@2.0.10 - please test - I'll close this issue shortly if either there's no response or if there's no details on "doesn't work for me". Cheers all.

@indranil786
Copy link

Hey @remy I installed the 2.0.10 version, and the problem is still showing.
This is my environment :

  • node version 14.16.1
  • nodemon version : 2.0.10
  • windows 10 - [Version 10.0.19043.1081] ( 21H1 version)
  • Tested on Gitbash and cmd and powershell

on bash

node10

on cmd

cmd

on powershell version - 5.1.19041.1023

powershell

The --dump file

--------------
node: v14.16.1
nodemon: 2.0.10
command: C:\Program Files\nodejs\node.exe C:\Users\asus\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js --dump index.js
cwd: C:\Users\asus\Desktop\nodeMon-test
OS: win32 x64
--------------
{
  run: false,
  system: { cwd: 'C:\\Users\\asus\\Desktop\\nodeMon-test' },
  required: false,
  dirs: [ 'C:\\Users\\asus\\Desktop\\nodeMon-test' ],
  timeout: 1000,
  options: {
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    runOnChangeOnly: false,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'index.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function (anonymous)],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'index.js' ] },
    string: 'node index.js'
  }
}
--------------

@0neMiss
Copy link
Author

0neMiss commented Jul 8, 2021

I just tried 2.0.10, its the same error for me, I'm personally going to be moving on to trying to figure out if its something in my local environment. I'll let you know if I find anything. Thanks so much for trying @remy

@remy
Copy link
Owner

remy commented Jul 8, 2021

@0neMiss I'm fairly certain it's not your environment as others are seeing the same thing - but I do know that I can't replicate (i.e. it doesn't show the stack), so it's possible it's linked to combination of versions.

For instance, does your env have anything in common with @indranil786's environment?

@0neMiss
Copy link
Author

0neMiss commented Jul 8, 2021

We appear to have the same PowerShell version but outside of that i dont see anything

Powershell:
image

Windows Build:
image

Windows Version:
image

git bash version:
image

--dump

--------------
node: v14.17.3
nodemon: 2.0.10
command: C:\Program Files\nodejs\node.exe C:\Users\unomi\OneDrive\Desktop\workwip_deployed\web-workwip\node_modules\nodemon\bin\nodemon.js --dump index.js
cwd: C:\Users\unomi\OneDrive\Desktop\workwip_deployed\web-workwip
OS: win32 x64
--------------
{
  run: false,
  system: {
    cwd: 'C:\\Users\\unomi\\OneDrive\\Desktop\\workwip_deployed\\web-workwip'
  },
  required: false,
  dirs: [
    'C:\\Users\\unomi\\OneDrive\\Desktop\\workwip_deployed\\web-workwip'
  ],
  timeout: 1000,
  options: {
    dump: true,
    ignore: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**',
      re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
    ],
    watch: [ '*.*', re: /.*\..*/ ],
    monitor: [
      '*.*',
      '!**/.git/**',
      '!**/.nyc_output/**',
      '!**/.sass-cache/**',
      '!**/bower_components/**',
      '!**/coverage/**',
      '!**/node_modules/**'
    ],
    ignoreRoot: [
      '**/.git/**',
      '**/.nyc_output/**',
      '**/.sass-cache/**',
      '**/bower_components/**',
      '**/coverage/**',
      '**/node_modules/**'
    ],
    restartable: 'rs',
    colours: true,
    execMap: { py: 'python', rb: 'ruby', ts: 'ts-node' },
    stdin: true,
    runOnChangeOnly: false,
    verbose: false,
    signal: 'SIGUSR2',
    stdout: true,
    watchOptions: {},
    execOptions: {
      script: 'index.js',
      exec: 'node',
      args: [],
      scriptPosition: 0,
      nodeArgs: undefined,
      execArgs: [],
      ext: 'js,mjs,json',
      env: {}
    }
  },
  load: [Function (anonymous)],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command: {
    raw: { executable: 'node', args: [ 'index.js' ] },
    string: 'node index.js'
  }
}
--------------

@indranil786
Copy link

I think both of us (@0neMiss ) have the same environment . PowerShell version is same. Although the git bash version is different and the windows build. But i don't think that it will be of any problem as in both the systems its not working.

@DineshRout779
Copy link

DineshRout779 commented Jul 9, 2021

1st

its not showing me error anymore, but its not updating the file contents.

2nd

@DineshRout779
Copy link

DineshRout779 commented Jul 9, 2021

Finally, I found this is another issue encountered a year before.
I just added the system32 folder to my system path and it worked like before. By the way, thanks, man! and sorry for the trouble, I caused unnecessarily.

@remy
Copy link
Owner

remy commented Jul 9, 2021

@DineshRout779 I'm pushing nodemon@2.0.11 to address this last issue you hit.

And closing the main issue now 👍

@remy remy closed this as completed Jul 9, 2021
@karbafoo
Copy link

karbafoo commented Jul 17, 2021

I managed to replicate it by disabling Windows Management Instrumentation service. docs. its a windows problem

@mohnndd
Copy link

mohnndd commented Jul 22, 2021

looks like everyone is having this issue, I will wait for an update then

@DineshRout779
Copy link

looks like everyone is having this issue, I will wait for an update then

NO, the problem is not linked with nodemon. It is linked with windows. Please make sure you have the system32 path specified in the system environment variable.

@JLParra
Copy link

JLParra commented Jul 23, 2021

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

@DineshRout779
Copy link

DineshRout779 commented Jul 23, 2021

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

Right click on This PC > properties > advanced settings > environment variables > Choose path in system. Make sure you have system32 path included.
This has solved my issue while I was working on a windows 7 pc some days before. But I have upgraded to win 10 recently, certainly there are no issues too. So I'm quite sure this has to do something with windows.

@luccasr73
Copy link

luccasr73 commented Jul 24, 2021

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

Right click on This PC > properties > advanced settings > environment variables > Choose path in system. Make sure you have system32 path included.
This has solved my issue while I was working on a windows 7 pc some days before. But I have upgraded to win 10 recently, certainly there are no issues too. So I'm quite sure this has to do something with windows.

Can send a print of who u config environment variables? I tried to add system32 to env in several different ways and nodemon didn't work again

@i-likhon
Copy link

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

Right click on This PC > properties > advanced settings > environment variables > Choose path in system. Make sure you have system32 path included.
This has solved my issue while I was working on a windows 7 pc some days before. But I have upgraded to win 10 recently, certainly there are no issues too. So I'm quite sure this has to do something with windows.

How to do that? https://prnt.sc/1p8qkqm

@gghosts
Copy link

gghosts commented Aug 16, 2021

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

Right click on This PC > properties > advanced settings > environment variables > Choose path in system. Make sure you have system32 path included.
This has solved my issue while I was working on a windows 7 pc some days before. But I have upgraded to win 10 recently, certainly there are no issues too. So I'm quite sure this has to do something with windows.

How to do that? https://prnt.sc/1p8qkqm

I'm having the same issue and not sure where to add the system32 path to the Environment Variables. Please advise!
root issue

@DineshRout779
Copy link

finish checking environment variables from Windows 10; apparently everything is fine but the error in nodemon persists; I don't know if you could tell me where exactly you modify the environment variables.
Thanks

Right click on This PC > properties > advanced settings > environment variables > Choose path in system. Make sure you have system32 path included.
This has solved my issue while I was working on a windows 7 pc some days before. But I have upgraded to win 10 recently, certainly there are no issues too. So I'm quite sure this has to do something with windows.

How to do that? https://prnt.sc/1p8qkqm

I'm having the same issue and not sure where to add the system32 path to the Environment Variables. Please advise!
root issue

Yes just click ok and try.

@kebee-k
Copy link

kebee-k commented Aug 16, 2021

@remy,@DineshRout779 Is that works for window 10 properly?
am also faced same problem

@DineshRout779
Copy link

@remy,@DineshRout779 Is that works for window 10 properly am also faced same problem

I think you should re install nodejs and try. Adding system32 path solved for me earlier when I was on a windows 7 machine.

@gghosts
Copy link

gghosts commented Aug 16, 2021

@remy,@DineshRout779 Is that works for window 10 properly am also faced same problem

I think you should re install nodejs and try. Adding system32 path solved for me earlier when I was on a windows 7 machine.

I was confused because I already have the path in my Environment system. Also completed uninstalled node as well with the issue remaining. Thanks for replying!

@khayrulamth
Copy link

I solved this problem by uninstalling nodemon version 2.0.12 and then installing 2.0.7

@MaqsudMallick
Copy link

I solved this problem by uninstalling nodemon version 2.0.12 and then installing 2.0.7

When I did that my nodemon continued to fail restarting albeit with no error message this time. it just froze at
nodemon restrating due to changes forever

@kebee-k
Copy link

kebee-k commented Sep 3, 2021

Those error are not from nodemon.its from your windows problem updates windows or reset windows can solves the issues.

@leleoveiga
Copy link

leleoveiga commented Sep 5, 2021

I solved this problem by uninstalling nodemon version 2.0.12 and then installing 2.0.7

worked out for me! thanks @khayrulamth

@khayrulamth
Copy link

I solved this problem by uninstalling nodemon version 2.0.12 and then installing 2.0.7

When I did that my nodemon continued to fail restarting albeit with no error message this time. it just froze at
nodemon restrating due to changes forever

You need to press clt+c and then npm start again if this happen.

@Muneeza93
Copy link

(node:20336) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=10200) get ProcessId 2> nul
at checkExecSyncError (child_process.js:760:11)
at execSync (child_process.js:833:15)
at kill (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\nodemon\lib\monitor\run.js:345:26)
at Function.run.kill (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\nodemon\lib\monitor\run.js:437:7)
at Bus. (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\nodemon\lib\monitor\run.js:507:7) at Bus.emit (events.js:412:35)
at restartBus (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\nodemon\lib\monitor\watch.js:228:7)
at FSWatcher.filterAndRestart (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\nodemon\lib\monitor\watch.js:212:16)
at FSWatcher.emit (events.js:400:28)
at FSWatcher.emitWithAll (C:\Users\U\Documents\workspace_2.0\bus.io_backend\node_modules\chokidar\index.js:540:8)
(Use node --trace-warnings ... to show where the warning was created)
(node:20336) 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:20336) [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.

@Muneeza93
Copy link

Guys i followed everything that has been said but still getting that error when nodemon tries rerunning my server

@Muneeza93
Copy link

but when i downgrade nodemon to 2.0.7 from 2.0.12 it works. Why does this happen? because going forward when working on another project nodemon will install the latest version and this means the same error may come up

@GusGF
Copy link

GusGF commented Sep 13, 2021

Node v14.15.4
NPM v6.14.10
Nodemon v2.0.12 but now reverted to v2.0.7
Windows 10 Pro 21H1
No gulp, grunt, webpack or docker just VSCode and the above.
I can confirm I have the system32 path specified in the system environment variable.

I was hoping making changes to my index.js would be picked up by Nodemon and propagated to my webpage but I cannot get the page to update to reflect the changes to my JS file. I make a change to my index.js, Nodemon running in my Git Bash console picks it up:
[nodemon] restarting due to changes...
But the webpage does not update when I refresh the page or do F5.

When I had Nodemon v2.0.12 I was getting the following error:

[nodemon] restarting due to changes...
(node:22336) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=22252) get ProcessId 2> nul

But then I downgraded Nodemon and the error disappeared but webpage still does not reflect changes when I refresh:

npm uninstall -g nodemon
npm i -g nodemon@2.0.7

@tanmaykk9
Copy link

tanmaykk9 commented Sep 13, 2021

Node v14.15.4
NPM v6.14.10
Nodemon v2.0.12 but now reverted to v2.0.7
Windows 10 Pro 21H1
No gulp, grunt, webpack or docker just VSCode and the above.
I can confirm I have the system32 path specified in the system environment variable.

I was hoping making changes to my index.js would be picked up by Nodemon and propagated to my webpage but I cannot get the page to update to reflect the changes to my JS file. I make a change to my index.js, Nodemon running in my Git Bash console picks it up:
[nodemon] restarting due to changes...
But the webpage does not update.

When I had Nodemon v2.0.12 I was getting the following error:

[nodemon] restarting due to changes...
(node:22336) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=22252) get ProcessId 2> nul

But then I downgraded Nodemon and the error disappeared but webpage still does not reflect changes when I refresh:

npm uninstall -g nodemon
npm i -g nodemon@2.0.7

The solution for this problem is the use of HotLoader. You need to configure Hotloader in your webpack.

@GusGF
Copy link

GusGF commented Sep 13, 2021

Node v14.15.4
NPM v6.14.10
Nodemon v2.0.12 but now reverted to v2.0.7
Windows 10 Pro 21H1
No gulp, grunt, webpack or docker just VSCode and the above.
I can confirm I have the system32 path specified in the system environment variable.
I was hoping making changes to my index.js would be picked up by Nodemon and propagated to my webpage but I cannot get the page to update to reflect the changes to my JS file. I make a change to my index.js, Nodemon running in my Git Bash console picks it up:
[nodemon] restarting due to changes...
But the webpage does not update.
When I had Nodemon v2.0.12 I was getting the following error:

[nodemon] restarting due to changes...
(node:22336) UnhandledPromiseRejectionWarning: Error: Command failed: wmic process where (ParentProcessId=22252) get ProcessId 2> nul

But then I downgraded Nodemon and the error disappeared but webpage still does not reflect changes when I refresh:

npm uninstall -g nodemon
npm i -g nodemon@2.0.7

The solution for this problem is the use of HotLoader. You need to configure Hotloader in your webpack.

I've no experience of Hotloader or webpack or even how your answer is related to Nodemon and the problems I'm having. I'm sure others on there don't use Hotloader or webpack and managed to get Nodemon to work. Not that it's even a Nodemon issue anyway.

@marciopedrocomba
Copy link

I still get the same error after doing everything said above...

@GusGF
Copy link

GusGF commented Sep 19, 2021

I still get the same error after doing everything said above...

I believe I've tried everything to try and get Nodemon working on my W10 system but so far have failed. I've switched to Supervisor and it works a treat for me. But I'd like to get Nodemon working so will be keeping an eye on developments.

@alishahvaladov
Copy link

I also had same issue. I have changed nodemon version from 2.0.14-alpha.1 to 2.0.15 and it fixed. But I don't know how.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests