upon updating to 2.0.9^ Unhandled promise rejection warning on save while running nodemon.
See original GitHub issuenodemon -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.
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.
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'
}
}
--------------
Issue Analytics
- State:
- Created 2 years ago
- Reactions:4
- Comments:64 (15 by maintainers)
Top Results From Across the Web
Command failed: wmic process after updating npm in Express ...
So, I've degraded the version to 2.0.7 which is working fine for me! npm uninstall nodemon npm install nodemon@2.0.7 --save-dev.
Read more >Unhandled Promise Rejections in Node.js - The Code Barbarian
DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.
Read more >nodemon waiting for changes before restart - You.com
When I "npm test" : I got first "[nodemon] clean exit - waiting for changes before restart" then if I "ctrl C": the...
Read more >What? UnhandledPromiseRejectionWarning - NodeBB
Trying to upgrade from 1.9.x to 2.4.0 but getting this. ... (node:155485) UnhandledPromiseRejectionWarning: Unhandled promise rejection.
Read more >How Can Nodemon Be Made To Work With Wsl 2 - ADocLib
nodemon. Monitor for any changes in your node.js application and upon updating to 2.0.9 Unhandled promise rejection warning on save while running nodemon....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
I managed to replicate it by disabling Windows Management Instrumentation service. docs. its a windows problem
I tried this but the error is still there. Now, I have installed 2.0.7 version and its working fine for me.