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.10.1 does not restart when source code file changes #895

Closed
xiedwill opened this issue Aug 18, 2016 · 30 comments
Closed

nodemon 1.10.1 does not restart when source code file changes #895

xiedwill opened this issue Aug 18, 2016 · 30 comments

Comments

@xiedwill
Copy link

xiedwill commented Aug 18, 2016

I install the latest nodemon (1.10.1) on Ubuntu 16.04, with node v6.4.0

npm install -g nodemon

then I run

nodemon server.js

and changes server.js, the server would not restart automatically. However, when I install an earlier version, and do the same thing, the server will restart correctly.

npm install -g [email protected]
@EngineeredTruth
Copy link

Looks like a bug with the new update. I reverted back to 1.10.0 for the time being!

@geooogle
Copy link

Same here

@remy
Copy link
Owner

remy commented Aug 18, 2016

@xiedwill @EngineeredTruth what OS are you running on? So I can check on my side to debug?

@xiedwill
Copy link
Author

@remy Ubuntu 16.04.1 LTS

@seamoss
Copy link

seamoss commented Aug 18, 2016

👍

Downgraded to 1.10.0, issue goes away.

Mac OSX 10.11.5
Node.js 6.4.0
NPM 3.10.3

@remy
Copy link
Owner

remy commented Aug 18, 2016

Anyone using Docker here? Or is this directly on the command line?

@seamoss
Copy link

seamoss commented Aug 18, 2016

Command line, here.

@xiedwill
Copy link
Author

Command Line directly.

@seamoss
Copy link

seamoss commented Aug 18, 2016

/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:212
              child.stdin.end();
                         ^

TypeError: Cannot read property 'end' of null
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:212:26)
    at emitTwo (events.js:106:13)
    at ChildProcess.emit (events.js:191:7)
    at maybeClose (internal/child_process.js:852:16)
    at Socket.<anonymous> (internal/child_process.js:323:11)
    at emitOne (events.js:96:13)
    at Socket.emit (events.js:188:7)
    at Pipe._handle.close [as _onclose] (net.js:492:12)

@fdocr
Copy link

fdocr commented Aug 18, 2016

On Mac OSX had the same problem with 1.10.1 (the revert/rollback isn't active yet, or npm still has 1.10.1 cached for now).

Also crashed on restarting manually from the command line

=> nodemon
[nodemon] 1.10.1
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `node ./bin/www`
rs
/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:212
              child.stdin.end();
                         ^

TypeError: Cannot read property 'end' of null
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/nodemon/lib/monitor/run.js:212:26)
    at emitTwo (events.js:87:13)
    at ChildProcess.emit (events.js:172:7)
    at maybeClose (internal/child_process.js:818:16)
    at Socket.<anonymous> (internal/child_process.js:319:11)
    at emitOne (events.js:77:13)
    at Socket.emit (events.js:169:7)
    at Pipe._onclose (net.js:469:12)

@seamoss
Copy link

seamoss commented Aug 18, 2016

@fdoxyz

npm rm nodemon -g
npm i [email protected] -g

@fdocr
Copy link

fdocr commented Aug 18, 2016

@seamoss yep, sorry didn't notice your comment while typing mine :)

@remy
Copy link
Owner

remy commented Aug 18, 2016

I posted a moment ago, but deleted the comment. It's happening on node@4 too.

I'm replicating with the rs command. I need to check what's going on with nodemon not restarting when the source changes.

@remy remy closed this as completed in be5d4e8 Aug 18, 2016
@bdanmo
Copy link

bdanmo commented Aug 18, 2016

Had the same issue; reverted and fixed. Change file would not restart, and when I tried rs command manually, stdin would be null, and the restart would fail.

@remy
Copy link
Owner

remy commented Aug 18, 2016

Latest version, 1.10.2 has the fix. Sorry for the disruption folks.

@seamoss
Copy link

seamoss commented Aug 30, 2016

👍 awesome!

@tomasdev
Copy link

@remy I'm experiencing this issue on a Docker image running nodemon, was it a known issue? I'm just going thru all open issues related to Docker in the meantime.

@vitorpiovezam
Copy link

vitorpiovezam commented Jan 5, 2018

Thanks, this works great @seamoss .

npm rm nodemon -g && npm i [email protected] -g

@remy
Copy link
Owner

remy commented Jan 5, 2018

@vitorpiovezam I'd recommend installing the latest version (1.14.x), there's been a lot of work since 1.10.0 so you might find a problem is fixed but also you can report new issues and they'll be investigated too.

@modikrunal202
Copy link

modikrunal202 commented Feb 12, 2018

@remy Updated to 1.14.10 and I can't get the server restarted on file changes.


$ nodemon -V --dump bin/www
[nodemon] 1.14.10
[nodemon] to restart at any time, enter `rs`
[nodemon] or send SIGHUP to 4136 to restart
[nodemon] watching: *.*
[nodemon] watching extensions: js,mjs,json
--------------
node: v9.3.0
nodemon: 1.14.10
command: C:\Program Files\nodejs\node.exe C:\Users\Krunal\AppData\Roaming\npm\node_modules\nodemon\bin\nodemon.js -V --dump bin/www
cwd: D:\Web Development\Node Js\restApiBook\restApiapp
OS: win32 x64
--------------
{ run: false,
  system:
   { cwd: 'D:\\Web Development\\Node Js\\restApiBook\\restApiapp' },
  required: false,
  dirs: [ 'D:\\Web Development\\Node Js\\restApiBook\\restApiapp' ],
  timeout: 1000,
  options:
   { verbose: true,
     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: /.*\..*/ ],
     ignoreRoot:
      [ '**/.git/**',
        '**/.nyc_output/**',
        '**/.sass-cache/**',
        '**/bower_components/**',
        '**/coverage/**',
        '**/node_modules/**' ],
     restartable: 'rs',
     colours: true,
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     runOnChangeOnly: false,
     signal: 'SIGUSR2',
     stdout: true,
     watchOptions: {},
     execOptions:
      { script: 'bin/www',
        exec: 'node',
        args: [],
        scriptPosition: 0,
        nodeArgs: undefined,
        execArgs: [],
        ext: 'js,mjs,json',
        env: {} },
     monitor:
      [ '*.*',
        '!**/.git/**',
        '!**/.nyc_output/**',
        '!**/.sass-cache/**',
        '!**/bower_components/**',
        '!**/coverage/**',
        '!**/node_modules/**' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  signal: 'SIGUSR2',
  command:
   { raw: { executable: 'node', args: [ 'bin/www' ] },
     string: 'node bin/www' } }
--------------

I'm changing and saving app.js and other js files in subfolders and nothing happens (server is not restarting).

@remy
Copy link
Owner

remy commented Feb 12, 2018

@modikrunal202 this is a closed issue. Please review the other open windows issues to see if it matches and add to those threads.

@gajjardarshithasmukhbhai

@xiedwill @EngineeredTruth what OS are you running on? So I can check on my side to debug?

sir please help i use the windows 10 node latest version and i install nodemon but server not restart automatically.my nodemon version is 1.18.9 please help me

@wvwhome
Copy link

wvwhome commented Mar 22, 2019

version 1.18.10 does NOT work for Windows 10 either
node --version
v10.15.3

nodemon --verbose web_server_1.js
[nodemon] 1.18.10
[nodemon] to restart at any time, enter rs
[nodemon] or send SIGHUP to 93400 to restart
[nodemon] watching: .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node web_server_1.js
[nodemon] forking
[nodemon] child pid: 97016
[nodemon] watching 0 files

@remy
Copy link
Owner

remy commented Mar 22, 2019 via email

@wvwhome
Copy link

wvwhome commented Mar 22, 2019 via email

@sumiie24
Copy link

sumiie24 commented Apr 10, 2019

Hello @remy Sir,
I am facing problem in nodemon, it works well when I don't work with server. But when I work with server, nodemon does not work. It is not able to start my "js" file.

When I save my code, it only shows-
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...

But not starting my "js" file again. Tell me where I am going wrong.
Please help me out or provide me a solution for it!

Operating System- Windows 10
nodemon version- 1.18.11
express version- 4.16.4
nodejs version- 11.10.1

@Charlotte000
Copy link

@sumiie24 , I had the same problem. My solution was adding C:\Windows\System32\ to the system variable in the PATH.

@khemchand123
Copy link

i install properly nodemon and show restart any changes
but in localhost not show any change which i update

cmd show->
D:\node.js\express-node-module>nodemon server.js
[nodemon] 2.0.2
[nodemon] to restart at any time, enter rs
[nodemon] watching dir(s): .
[nodemon] watching extensions: js,mjs,json
[nodemon] starting node server.js
i at server 3000 local host
[nodemon] restarting due to changes...
[nodemon] restarting due to changes...

@virendrapatel62
Copy link

@sumiie24 , I had the same problem. My solution was adding C:\Windows\System32\ to the system variable in the PATH.

Amazing Thanks A Lot

@ridbay
Copy link

ridbay commented Aug 9, 2020

This works for me;

Delete these directories; C:/Users/{user}/AppData/Roaming/npm and C:/Users/{user}/AppData/Roaming/npm-cache and re-installed global npm modules.

Sheers!!

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

No branches or pull requests