Nodemon: Restart not working on file change

Created on 27 May 2016  路  11Comments  路  Source: remy/nodemon

Hi All,
Does not seem to be working for me anymore? Included is some info, hope it helps 馃槃

Version

Nodemon v1.9.2

Command

[nodemon] 1.9.2
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: *.*
[nodemon] starting `NODE_ENV=dev node --use-strict app -c "node --use-strict" app`
Working[3000]

Additional Info

nodemon -V --dump app.js 
[nodemon] 1.9.2
[nodemon] to restart at any time, enter `rs`
[nodemon] ignoring: /Users/karlbateman/Projects/NodeJS/api/.git/**/* .nyc_output coverage /Users/karlbateman/Projects/NodeJS/api/node_modules/**/*
[nodemon] watching: *.*
[nodemon] watching extensions: js,json
--------------
node: v5.1.0
nodemon: 1.9.2
command: /Users/karlbateman/.nvm/versions/node/v5.1.0/bin/node /Users/karlbateman/.nvm/versions/node/v5.1.0/bin/nodemon -V --dump app.js
cwd: /Users/karlbateman/Projects/NodeJS/api
OS: darwin x64
--------------
{ run: false,
  system: { cwd: '/Users/karlbateman/Projects/NodeJS/api' },
  required: false,
  dirs: [ '/Users/karlbateman/Projects/NodeJS/api' ],
  timeout: 1000,
  options: 
   { verbose: true,
     dump: true,
     ignore: 
      [ '.git',
        '.nyc_output',
        'coverage',
        'node_modules',
        re: /\.git|\.nyc_output|\-cache|coverage|node_modules/ ],
     watch: [ '*.*', re: /.*\..*/ ],
     ignoreRoot: 
      [ '.git',
        '.nyc_output',
        'coverage',
        'node_modules' ],
     restartable: 'rs',
     colours: true,
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     runOnChangeOnly: false,
     stdout: true,
     execOptions: 
      { script: 'app.js',
        exec: 'node',
        args: [],
        scriptPosition: 0,
        nodeArgs: undefined,
        ext: 'js,json',
        env: {},
        execArgs: [] },
     monitor: 
      [ '*.*',
        '!/Users/karlbateman/Projects/NodeJS/api/.git/**/*',
        '!.nyc_output',
        '!coverage',
        '!/Users/karlbateman/Projects/NodeJS/api/node_modules/**/*' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  command: 
   { raw: { executable: 'node', args: [ 'app.js' ] },
     string: 'node app.js' } }
--------------
[nodemon] exiting

Regards,
@karlbateman

Most helpful comment

I'm experiencing this too, but on two projects both using 1.9.2 馃槙.

In this project, restart works (running $ nodemon -e js,md,scss,handlebars --exec 'node build-static.js' -V). It says it is watching 465 files.

In this other project, restart does not work (running $ nodemon -e js,md,scss,handlebars,hbt --exec 'node index.js' -V). It says it is watching 0 files.

@karlbateman could you try adding the -V flag to see if your also says watching 0 files?

All 11 comments

You mention _anymore_. What's changed? I'll look at that first.

Nothing, I know it would be a new version since I last used it? But I can't remember the version previously which was working for me. None of my code has changed, it seems that this has decided to just stop working?

I'm experiencing this too, but on two projects both using 1.9.2 馃槙.

In this project, restart works (running $ nodemon -e js,md,scss,handlebars --exec 'node build-static.js' -V). It says it is watching 465 files.

In this other project, restart does not work (running $ nodemon -e js,md,scss,handlebars,hbt --exec 'node index.js' -V). It says it is watching 0 files.

@karlbateman could you try adding the -V flag to see if your also says watching 0 files?

I can confirm that running the command with the -V flag does indeed show that 0 files are being watched. @JuanCaicedo thanks for pointing that out 馃槃

Damnit - I'm able to replicate and I finally managed to work out what was going wrong.

It's Chokidar (which is the underlying file watch system), it doesn't like the directory name: juancaicedo.github.io but changing it to juancaicedo does work.

I've been wanting to send a PR to Chokidar to fix this but I've not had the time at all, and it requires the fix in two places (for multiple OSs).

I'm going to close, but only because we have a work around, not a solution 馃槮

Weeeeird, but thanks for the fix! @karlbateman does your directory have something similar?

@JuanCaicedo no, mine is just a standard express app. I don't understand what the issue is? @remy What is the workaround for my case?

@karlbateman do you have a public repo that I replicate this with?

@remy Hey, please see this repo. I hope it helps :smile:

@remy (and for anyone finding this issue) I don't have a public repo you can test on, but I can confirm that changing the _root_ directory name to not have an _ fixes the issue for me. I changed it from some_repo to somerepo and that got it working.

I had the same issue.
My root directory was named "mysite.git" and nodemon was watching 0 file. I had renamed my root directory without the dot and nodemon now works as expected.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

robboerman picture robboerman  路  3Comments

jonerer picture jonerer  路  4Comments

olalonde picture olalonde  路  3Comments

fabianMendez picture fabianMendez  路  4Comments

remy picture remy  路  5Comments