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

nodemon 1.18.9 not working in windows 10 *64 #1501

Closed
Devpokhariya opened this issue Jan 9, 2019 · 48 comments
Closed

nodemon 1.18.9 not working in windows 10 *64 #1501

Devpokhariya opened this issue Jan 9, 2019 · 48 comments
Labels
needs more info not enough information in issue to debug stale no activity for 2 weeks windows

Comments

@Devpokhariya
Copy link

I have installed nodemon
npm install nodemon --g
and the server is starting as it is suppose to but then while i change in my file
it says
restarting due to changes...
and nothing other then this line and the weird thing is
the server didnot restart i have restarted my pc tried updating the nodemon my friend is using same thing and in his computer it worked but not mine. I m not sure what the isuue is.
Can anyone help me here.
nodemon index.js [nodemon] 1.18.9 [nodemon] to restart at any time, enterrs[nodemon] watching: *.* [nodemon] startingnode index.js the app is running.... [nodemon] restarting due to changes...

@NinthAutumn
Copy link

I have this exact problem! it works on my macbook but not in my windows.... =_=

@RitvikSangwan
Copy link

I am also facing the same problem on windows 8.1 and nodemon version 1.18.9

@remy
Copy link
Owner

remy commented Jan 13, 2019

Care to debug rather than "me too"? Happy to take PRs that will fix or even some actual debugging information to replicate and fix…

@remy remy added needs more info not enough information in issue to debug windows labels Jan 13, 2019
@llupRisinglll
Copy link

llupRisinglll commented Jan 14, 2019

I got this glitch after installing the latest update of nodemon. So I tried to revert back to the old version and it doesn't do anything. I think the update does something on the windows operating system that cannot remove even after uninstall and installing (reinstall) the nodemon package.
I believe the problem can be solve by reinstalling the os as stated on the previous Issue, #1461 (comment) but this isn't an efficient fix.

@llupRisinglll
Copy link

I tries debugging by reverting back to old versions... and guess what?
For windows machine, please stick with version 1.17.15. It is working well and will fix the bug.
Use npm i -g [email protected] hope that helps.

@remy
Copy link
Owner

remy commented Jan 14, 2019

Those old versions also include deep vulnerabilities, which is why older versions are not supported.

@llupRisinglll
Copy link

llupRisinglll commented Jan 14, 2019

I am using version 1.17.15 for about an hour now and it was stuck at restarting due to changes. The same issue in version 1.18.x.
It stopped working after a trying to save changes multiple times before the "Starting node app.js" message appear.
The problem is somewhat hard to figure out since the installation also WARNs about the optional module fsevent not being able to install.

@bke-daniel
Copy link

bke-daniel commented Jan 18, 2019

Hello everyone,

some goes for OSX. Info nodemon is installed locally, not globally.
node -v v8.15.0 npx nodemon -v 1.18.9

We had this in #1435.

Edit:
Tried to add a nodemon.json (with and without --config) as well as adding config to the package.json

Cheers,
Daniel

@LemuelCushing
Copy link

Same here, been looking for a solution all over. Windows 10, reverting to @1.17.15 didn't make a difference

@stale
Copy link

stale bot commented Feb 4, 2019

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

@stale stale bot added the stale no activity for 2 weeks label Feb 4, 2019
@remy
Copy link
Owner

remy commented Feb 8, 2019

Can you all retest with [email protected] - it might fix the issue you were seeing.

Otherwise, since there's been no interest in finding the source of the issue on this thread, I'll close it in a few days.

@stale stale bot removed the stale no activity for 2 weeks label Feb 8, 2019
@LemuelCushing
Copy link

Hi @remy, I've upgraded to 1.18.10, but to no avail..

@remy
Copy link
Owner

remy commented Feb 11, 2019

@LemuelCushing can you detail what you're seeing and how you're able to replicate with as little code as possible?

@tylerreece22
Copy link

tylerreece22 commented Feb 14, 2019

If you want to use nodemon on Windows 10 but can't get it to work globally you can always install it as a dev dependency, cd into your project directory, and run yarn run nodemon and it will function the same. Hope that helps.

@LemuelCushing
Copy link

@remy sorry for the delay - I've just set up a simple package with nothing but nodemon and the basic "hello world" app.js file. I'm using nodemon as a dev dependency, and my yarn start is set to nodemon app.js.
When I start it, I get the usual message:

 ⨯ Lemuel Cushing@CUTHBERT  C\..\nodemon_test  yarn start
yarn run v1.13.0
$ nodemon app.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node app.js`
Server running at http://127.0.0.1:3000/

When I make a change to app.js and save it, I get
[nodemon] restarting due to changes...
Which just hangs.

If I add the -V flag, the follwing is displayed:

 Lemuel Cushing@CUTHBERT  C\..\nodemon_test  yarn start
yarn run v1.13.0
$ nodemon -V app.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 34116 to restart
[nodemon] watching: *.*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node app.js`
[nodemon] forking
[nodemon] child pid: 10640
[nodemon] watching 3 files
Server running at http://127.0.0.1:3000/

And after I save a change:

[nodemon] files triggering change check: app.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] app.js

[nodemon] files triggering change check: app.js
[nodemon] matched rule: **\*.*
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] app.js

@stale
Copy link

stale bot commented Mar 10, 2019

This issue has been automatically marked as idle and stale because it hasn't had any recent activity. It will be automtically closed if no further activity occurs. If you think this is wrong, or the problem still persists, just pop a reply in the comments and @remy will (try!) to follow up.
Thank you for contributing <3

@stale stale bot added the stale no activity for 2 weeks label Mar 10, 2019
@stale stale bot closed this as completed Mar 17, 2019
@CodeWilliamson
Copy link

I'm having same issue on Windows Server 2016. I've tried nodemon globally and locally and no luck. If I run in verbose mode it says watching 0 files despite having my app.js file clearly present. It also reads that it's watching . with extensions: js,mjs,json ... anybody having luck with this?

@jordanbtucker
Copy link

The issue is with chokidar since 2.1.3. See paulmillr/chokidar#812

This can be fixed in nodemon by setting atomic to false in the options for chokidar.watch.

@paulmillr
Copy link

Fixed chokidar.

@remy
Copy link
Owner

remy commented Mar 23, 2019 via email

@d4rth-v4d3r
Copy link

I'm having a similiar issue in Windows 10 Pro and [email protected]. I'm using the command:

yarn cross-env NODE_ENV=development nodemon --watch dist-dev --inspect dist-dev/lib/index.js

Nodemon is not restarting when a file is modified 😢. I installed version 1.18.0 and this command works like a charm. 🐱‍🐉

@jordanbtucker
Copy link

@d4rth-v4d3r What do you get when you run this?

npm ls | findstr "chokidar"

If you see [email protected] or [email protected], then that's your problem. It needs to be [email protected] or later.

@jordanbtucker
Copy link

jordanbtucker commented Apr 8, 2019

Star, I'll push a bumpped version of nodemon to pull the updated dep (others: you sho be able to reinstall nodemon and it should pick up the latest change in chokidar.

@remy Can you bump the chokidar dependency to 2.1.5? Currently, reinstalling nodemon doesn't work if [email protected] is already in the dependency tree either directly or from another package.

For example, if I run npm i -D [email protected], reinstalling nodemon is not going to pull down [email protected]. It's just going to use 2.1.3, which has the bug.

Nuking node_modules and reinstalling should work, but only if another package hasn't pinned [email protected].

@d4rth-v4d3r
Copy link

This is my output

| +-- [email protected]
| +-- [email protected] extraneous

@jordanbtucker
Copy link

@d4rth-v4d3r That's strange. What are the dependencies and devDependencies in package.json?

@d4rth-v4d3r
Copy link

d4rth-v4d3r commented Apr 8, 2019

"dependencies": {
        "apollo-server": "^2.4.8",
        "apollo-server-express": "^2.4.8",
        "body-parser": "^1.18.2",
        "cors": "^2.8.4",
        "dataloader": "^1.4.0",
        "dataobject-parser": "^1.2.1",
        "express": "^4.16.3",
        "express-graphql": "^0.6.12",
        "graphql": "^0.13.2",
        "graphql-compose": "^4.3.0",
        "graphql-date": "^1.0.3",
        "http-status-codes": "^1.3.2",
        "humps": "^2.0.1",
        "jsonwebtoken": "^8.5.0",
        "lodash": "^4.17.10",
        "moment": "^2.22.1",
        "mongo-ts-wrapper": "^2.3.0",
        "mongodb": "^3.0.7",
        "mongodb-migrations": "^0.8.5",
        "mongoose": "^5.5.0",
        "mssql": "^4.1.0",
        "node-cron": "^1.2.1",
        "node-yaml-config": "^0.0.4",
        "p-iteration": "^1.1.7",
        "passport": "^0.4.0",
        "passport-jwt": "^4.0.0",
        "pouch-ts-wrapper": "2.0.1",
        "pouchdb": "6.4.3",
        "pouchdb-find": "6.4.3",
        "pouchdb-server": "4.0.1",
        "reflect-metadata": "^0.1.12",
        "sequelize": "^4.37.10",
        "sequelize-typescript": "^0.6.5",
        "serialize-error": "^3.0.0",
        "sql-template-strings": "^2.2.2",
        "token-gen": "^0.5.0",
        "typed-rest-client": "^1.0.7",
        "winston": "^3.0.0"
    },
    "devDependencies": {
        "@types/express": "^4.16.1",
        "@types/express-graphql": "^0.6.2",
        "@types/jest": "^23.0.0",
        "@types/jsonwebtoken": "^8.3.2",
        "@types/lodash": "4.14.109",
        "@types/mongodb": "^3.0.19",
        "@types/mongoose": "^5.3.25",
        "@types/node-cron": "^1.2.0",
        "@types/passport": "^1.0.0",
        "@types/passport-jwt": "^3.0.1",
        "@types/pouchdb": "^6.3.2",
        "babel-cli": "^6.26.0",
        "babel-core": "^6.26.3",
        "babel-eslint": "^8.2.3",
        "babel-jest": "^22.4.3",
        "babel-plugin-syntax-async-functions": "^6.13.0",
        "babel-plugin-syntax-async-generators": "^6.13.0",
        "babel-plugin-transform-class-properties": "^6.24.1",
        "babel-plugin-transform-es2015-modules-commonjs": "^6.26.2",
        "babel-plugin-transform-es2015-template-literals": "^6.22.0",
        "babel-plugin-transform-flow-strip-types": "^6.22.0",
        "babel-plugin-transform-object-rest-spread": "^6.26.0",
        "babel-preset-env": "^1.7.0",
        "babel-preset-es2015": "^6.24.1",
        "babel-preset-stage-0": "^6.24.1",
        "babel-preset-stage-2": "^6.24.1",
        "beautify-benchmark": "^0.2.4",
        "benchmark": "^2.1.4",
        "coveralls": "^3.0.1",
        "cross-env": "^5.2.0",
        "eslint": "^4.19.1",
        "eslint-plugin-babel": "^5.1.0",
        "eslint-plugin-flowtype": "^2.46.3",
        "eslint-plugin-prettier": "^2.6.0",
        "eslint-plugin-react": "^7.7.0",
        "flow-bin": "^0.71.0",
        "isparta": "^4.0.0",
        "jest": "^23.0.0",
        "node-fetch": "^2.2.0",
        "nodemon": "1.18.0",
        "pouchdb-adapter-memory": "^7.0.0",
        "prettier": "^1.12.1",
        "regenerator-runtime": "^0.11.1",
        "sane": "^2.5.0",
        "ts-jest": "^23.0.0",
        "typescript": "^3.3.3333"
    }

@remy
Copy link
Owner

remy commented Apr 8, 2019

@d4rth-v4d3r your version of nodemon is 1.18.0 not the latest.

@jordanbtucker thank you for your support on this thread - much appreciated 👍 ❤️

I'm pushing a release that upgrades chokidar directly - though most users should get the dep upgrade automatically as it pulls chokidar@^2.1.0

@jordanbtucker
Copy link

@d4rth-v4d3r I installed your dependencies. I was able to get it working by reinstalling nodemon.

npm uninstall --save-dev nodemon
npm install --save-dev nodemon

Since nodemon is the only dependency that requires [email protected], [email protected] will also get reinstalled at the latest version. Note that this is different than npm update nodemon as that won't necessarily update chokidar, at least not until remy bumps the chokidar dependency in nodemon.

@d4rth-v4d3r
Copy link

@remy I revert from version 1.18.10 to 1.18.0 because it was not working

@victorpigmeo
Copy link

I'm having this issue with 1.19.0, windows 10 64bits also.

@jordanbtucker
Copy link

@victorblq What do you get when you run this?

npm ls | findstr "chokidar"

I just want to rule out whether it's an issue with chokidar.

@victorpigmeo
Copy link

@jordanbtucker this:

$ npm ls | findstr "chokidar"
  +-- [email protected]

@jordanbtucker
Copy link

jordanbtucker commented May 23, 2019

Thanks. How about this?

npx cross-env DEBUG=nodemon nodemon -V -w dir dir

Replace dir twice with the name of the directory you want to watch. Make sure there's at least one .js file in that directory.

@victorpigmeo
Copy link

victorpigmeo commented May 24, 2019

I'm following an expressjs tutorial, if I run:

yarn start

it works, but not refresh with code changes (this original issue)
and when I run with yout snippet, replacing "dir" with "src", that in my case contains a index.js file, I get this:

$ npx cross-env DEBUG=nodemon nodemon -V -w src src
npx: instalou 10 em 1.335s
  nodemon bus new listener: reset (0) +0ms
  nodemon bus new listener: reset (0) +1ms
  nodemon bus new listener: quit (0) +8ms
  nodemon bus new listener: quit (0) +0ms
  nodemon bus new listener: restart (0) +0ms
  nodemon bus new listener: restart (0) +0ms
  nodemon bus new listener: reset (2) +3ms
  nodemon bus emit: reset +1ms
  nodemon resetting watchers +0ms
  nodemon reset +0ms
  nodemon config: dirs [ 'C:\\Users\\victo\\Workspaces\\express\\src' ] +0ms
[nodemon] 1.19.0
[nodemon] to restart at any time, enter `rs`
  nodemon bus new listener: error (0) +44ms
  nodemon bus new listener: error (0) +0ms
[nodemon] or send SIGHUP to 16560 to restart
[nodemon] watching: C:\Users\victo\Workspaces\express\src/**/*
[nodemon] watching extensions: js,mjs,json
[nodemon] starting `node src`
[nodemon] forking
  nodemon fork C:\Windows\system32\cmd.exe /d /s /c node src +0ms
[nodemon] child pid: 18212
  nodemon bus new listener: exit (0) +8ms
  nodemon bus new listener: exit (0) +0ms
  nodemon start watch on: [ 'src', re: /src/ ] +1ms
  nodemon start watch on: C:\Users\victo\Workspaces\express\src +53ms
  nodemon ignored [
  '**/.git/**',
  '**/.nyc_output/**',
  '**/.sass-cache/**',
  '**/bower_components/**',
  '**/coverage/**',
  '**/node_modules/**',
  re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/
] +0ms
  nodemon watch is complete +37ms
[nodemon] watching 1 file
C:\Users\victo\Workspaces\express\src\index.js:1
import express from 'express';
       ^^^^^^^

SyntaxError: Unexpected identifier
    at Module._compile (internal/modules/cjs/loader.js:718:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:785:10)
    at Module.load (internal/modules/cjs/loader.js:641:32)
    at Function.Module._load (internal/modules/cjs/loader.js:556:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:837:10)
    at internal/main/run_main_module.js:17:11
[nodemon] app crashed - waiting for file changes before starting...

actually, I'm working at my laptop now(Linux) and everything is fine. Logged at my desktop(Windows) just to test your solution in case of anyone need it.

@jordanbtucker
Copy link

This looks like a different issue since it's actually watching the file:

[nodemon] watching 1 file

The error you're getting is because it needs to be transpiled with something like babel.

Try this:

npx cross-env DEBUG=nodemon nodemon -V -w src --exec babel-node src

@shahidfoy
Copy link

shahidfoy commented Jun 20, 2019

I had the same issue Windows 10, for whatever reason nodemon wont run on some of my projects,

here's a duck-tape work around, ask npm to run a nodemon script in package.json
"scripts": { "dev": "nodemon server" },

then just run npm run dev
currently works for me

using
"nodemon": "^1.19.1"

another thing that worked for me was deleting the package-lock.json (make a copy if you scared) then closing all text editors/ide's & terminals associated with the application and opening them again and run npm install in the terminal to reload package-lock.json. This allowed me to use nodemon and ng commands (was having issues with ng too)

@jordanbtucker
Copy link

@shahidfoy Just running nodemon will run the global install of nodemon. You can find out what version that is by running npm ls -g nodemon. Running npm run dev will run the version of nodemon installed in node_modules. That's probably why you're seeing different behavior.

@Charlotte000
Copy link

Charlotte000 commented Aug 27, 2019

I had the same problem on win 7. The issue was founded accidentally. My solution was adding C:\Windows\System32\ to the system variable in the PATH.

@jhonissongabriel
Copy link

jhonissongabriel commented Oct 13, 2019

This worked for me!

npm install -g nodemon

npm install --save-dev nodemon

npm config get prefix

set PATH=%PATH%;C:\Users"Your User"\AppData\Roaming\npm;

Source:
https://cursos.alura.com.br/forum/topico-nao-consigo-instalar-o-nodemon-23149

@bernarddoci
Copy link

bernarddoci commented Oct 29, 2019

You should run PowerShell as administrator then:
PS C:\WINDOWS\system32> Set-ExecutionPolicy RemoteSigned
and press A

@deepak-singh343
Copy link

I had the same problem on win 7. The issue was founded accidentally. My solution was adding C:\Windows\System32\ to the system variable in the PATH.

it also worked for me in windows 10 64bit

@fpsantos86
Copy link

I'm having the same problem, can you help me please??? How can i solve it???

@deepak-singh343
Copy link

deepak-singh343 commented Feb 18, 2020 via email

@fpsantos86
Copy link

@remy sorry for the delay - I've just set up a simple package with nothing but nodemon and the basic "hello world" app.js file. I'm using nodemon as a dev dependency, and my yarn start is set to nodemon app.js.
When I start it, I get the usual message:

⨯ Lemuel Cushing@CUTHBERT  C..\nodemon_test  yarn start
yarn run v1.13.0
$ nodemon app.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter rs
[nodemon] watching: .
[nodemon] starting node app.js
Server running at http://127.0.0.1:3000/
When I make a change to app.js and save it, I get
[nodemon] restarting due to changes...
Which just hangs.

If I add the -V flag, the follwing is displayed:

Lemuel Cushing@CUTHBERT  C..\nodemon_test  yarn start
yarn run v1.13.0
$ nodemon -V app.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter rs
[nodemon] or send SIGHUP to 34116 to restart
[nodemon] watching: .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node app.js
[nodemon] forking
[nodemon] child pid: 10640
[nodemon] watching 3 files
Server running at http://127.0.0.1:3000/
And after I save a change:

[nodemon] files triggering change check: app.js
[nodemon] matched rule: **.
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] app.js

[nodemon] files triggering change check: app.js
[nodemon] matched rule: **.
[nodemon] changes after filters (before/after): 1/1
[nodemon] restarting due to changes...
[nodemon] app.js

@LemuelCushing Can you solve it???

Send me a message to [email protected], if you can please

@fpsantos86
Copy link

Can you all retest with [email protected] - it might fix the issue you were seeing.

Otherwise, since there's been no interest in finding the source of the issue on this thread, I'll close it in a few days.

@remy I retested it but when I update the file and make a new request I get the previous result, even with the nodemon running.

Note: I started getting this problem with the latest version of the nodemon: 2.0.2

@fpsantos86
Copy link

@remy

It seems that this problem has returned, the nodemon even runs the application, but after I change a file and save the request executed by Insomnia (a program like the postman) it returns the same value as before.

BEFORE CHANGING THE NORMAL EXECUTE FILE:
image

NOTICE THAT AFTER I CHANGE FROM "CLÁUDIO" TO "ROBSON" THE ANSWER IN INSOMNIA:
image

Help me please. I've searched a lot on the internet but I think this is the right place.

@copiyot
Copy link

copiyot commented Mar 4, 2020

#1619 (comment) .... That link has the answer.

@postoyevstanislav
Copy link

  1. Start Windows PowerShell with the "Run as Administrator" option. Only members of the
    Administrators group on the computer can change the execution policy.

  2. Enable running unsigned scripts by entering:

    set-executionpolicy remotesigned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs more info not enough information in issue to debug stale no activity for 2 weeks windows
Projects
None yet
Development

No branches or pull requests