Nodemon: [nodemon] watching 0 files

Created on 8 Jan 2016  路  21Comments  路  Source: remy/nodemon

Hi Remy,

first of all, thanks for the great module. I just upgraded to 1.8.1 and my watch command seems to have stopped working. I checked the FAQ and tried to use legacy watch, but still could not get nodemon to watch any files.

Here's the directory

$ ll
total 104
-rw-r--r--    1 yawetse  staff     36 Sep  8  2014 AUTHORS
-rw-r--r--    1 yawetse  staff      0 Sep  8  2014 Changelog
-rw-r--r--    1 yawetse  staff   5301 Nov 12 22:07 Gruntfile.js
-rw-r--r--    1 yawetse  staff   1076 Sep  8  2014 LICENSE
-rw-r--r--    1 yawetse  staff   5371 Oct 25 17:09 README.md
drwxr-xr-x    7 yawetse  staff    238 Jan  8 01:12 app
drwxr-xr-x    2 yawetse  staff     68 Jan  8 02:08 cache
drwxr-xr-x    5 yawetse  staff    170 Jan  8 01:12 content
drwxr-xr-x    4 yawetse  staff    136 Jan  8 01:12 doc
-rw-r--r--    1 yawetse  staff   2611 Nov 19 11:13 index.js
-rw-r--r--    1 yawetse  staff    276 Sep  8  2014 jsdoc.json
drwxr-xr-x    5 yawetse  staff    170 Jan  8 01:50 logs
drwxr-xr-x  262 yawetse  staff   8908 Jan  8 01:14 node_modules
-rw-r--r--    1 yawetse  staff    383 Jan  8 01:53 nodemon.old.json
-rw-r--r--    1 yawetse  staff  10936 Jan  8 01:40 package.json
drwxr-xr-x    3 yawetse  staff    102 Oct  8  2014 processes
drwxr-xr-x    9 yawetse  staff    306 Jan  8 01:16 public
drwxr-xr-x   19 yawetse  staff    646 Jan  8 01:12 releases
-rw-r--r--    1 yawetse  staff    142 Oct 25 17:09 runforever.sh
drwxr-xr-x    9 yawetse  staff    306 Jan  8 01:12 scripts
drwxr-xr-x    5 yawetse  staff    170 Jan  8 01:12 test

Here's the result of the watch command (both via a nodemon.json config file and as command line arguments).

$ nodemon --watch app --watch index.js -L -V
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] ignoring: .git /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/node_modules/**/* bower_components .sass-cache
[nodemon] watching: /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/app/**/* index.js
[nodemon] watching extensions: js,json
[nodemon] starting `node index.js`
[nodemon] child pid: 62745
[nodemon] watching 0 files

here's the full dump

$ nodemon --watch app --watch index.js -L -V --dump
[nodemon] 1.8.1
[nodemon] to restart at any time, enter `rs`
[nodemon] ignoring: .git /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/node_modules/**/* bower_components .sass-cache
[nodemon] watching: /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/app/**/* index.js
[nodemon] watching extensions: js,json
--------------
node: v4.2.4
nodemon: 1.8.1
command: /Users/yawetse/.nvm/versions/node/v4.2.4/bin/node /Users/yawetse/.nvm/versions/node/v4.2.4/bin/nodemon --watch app --watch index.js -L -V --dump
cwd: /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs
OS: darwin x64
--------------
{ run: false,
  system: { cwd: '/Users/yawetse/Developer/github/test/node424/node_modules/periodicjs' },
  required: false,
  dirs: 
   [ '/Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/app',
     '/Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/index.js' ],
  timeout: 1000,
  options: 
   { watch: [ 'app', 'index.js', re: /app|index\.js/ ],
     legacyWatch: true,
     verbose: true,
     dump: true,
     ignore: 
      [ '.git',
        'node_modules',
        'bower_components',
        '.sass-cache',
        re: /\.git|node_modules|bower_components|\.sass\-cache/ ],
     ignoreRoot: [ '.git', 'node_modules', 'bower_components', '.sass-cache' ],
     restartable: 'rs',
     colours: true,
     execMap: { py: 'python', rb: 'ruby' },
     stdin: true,
     runOnChangeOnly: false,
     stdout: true,
     execOptions: 
      { script: 'index.js',
        exec: 'node',
        args: [],
        scriptPosition: 0,
        nodeArgs: undefined,
        ext: 'js,json',
        env: {},
        execArgs: [] },
     monitor: 
      [ '/Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/app/**/*',
        'index.js',
        '!.git',
        '!/Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/node_modules/**/*',
        '!bower_components',
        '!.sass-cache' ] },
  load: [Function],
  reset: [Function: reset],
  lastStarted: 0,
  loaded: [],
  watchInterval: null,
  command: 
   { raw: { executable: 'node', args: [ 'index.js' ] },
     string: 'node index.js' } }
--------------
[nodemon] exiting

Most helpful comment

this seems like the right issue to add this to:

if the PWD has special characters, weird things happen:

  • ( and/or ) in pwd: watching 0 files
  • { and/or } in pwd: watching everything, even excluded stuff

All 21 comments

just as a point of reference when I revert back all the to version 1.2.1 it works without issue

$ nodemon --watch app --watch index.js -L -V 
8 Jan 02:15:09 - [nodemon] v1.2.1
8 Jan 02:15:09 - [nodemon] to restart at any time, enter `rs`
8 Jan 02:15:09 - [nodemon] ignoring: .git /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/node_modules/**/* bower_components .sass-cache
8 Jan 02:15:09 - [nodemon] watching: /Users/yawetse/Developer/github/test/node424/node_modules/periodicjs/app/**/* index.js
8 Jan 02:15:09 - [nodemon] watching extensions: js
8 Jan 02:15:09 - [nodemon] starting `node index.js`
8 Jan 02:15:09 - [nodemon] child pid: 63125
8 Jan 02:15:09 - [nodemon] watching 57 files

version 1.4.1 was the last version to work (i suppose it's related to the move to chokidar. Does using NVM have any impact on compatibility?

I'm also experiencing the "watching 0 files" no mater what I do, with or without -L... same 1.8.1 version of nodemon.

I'm experiencing the same. v1.4.1 works.

I'm also using nvm, but i don't think that matters.

Confirmed on Mac OS X 10.11.5 with Node v6.2.2. nodemon 1.9.2 is watching 0 files; 1.4.1 works, but has some nasty deprecation warnings on its dependencies:

npm WARN deprecated [email protected]: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
npm WARN deprecated [email protected]: graceful-fs v3.0.0 and before will fail on node releases >= v7.0. Please update to graceful-fs@^4.0.0 as soon as possible. Use 'npm ls graceful-fs' to find it in the tree.

this seems like the right issue to add this to:

if the PWD has special characters, weird things happen:

  • ( and/or ) in pwd: watching 0 files
  • { and/or } in pwd: watching everything, even excluded stuff

Adding to @e110c0 's finding, my project directory had a period in it: ~/projects/bhb603.github.io/ and this caused nodemon to watch 0 files. I changed the directory name to ~/projects/bhb603/ and now nodemon watches all the files I configured it to watch.

My hunch is that the period in the directory is messing with whatever regex/string-matching is used to filter out file extensions....

Anyway, here's my setup:

node: v6.9.4 (using nvm)
nodemon: 1.11.0
OSX 10.11.6

That would make sense, since I have every single one of my git repos ending in ".git".

I have the same problem. Zero files are watched when the git repo contains ".git" in the name (ex: beautyrefuge.github.io). For example, the naming convention "projectname.github.io" for GitHub Pages does not work with Nodemon. The ".github." in the repo name causes the problem. Removing the ".github." from the project name fixed the problem for me.

Just to add my $0.02 - I was having a similar problem on a macOS system. It turned out that Dropbox was the problem - I was storing the source files within the Dropbox folder, which seems to lock the ability to watch the files to itself, thus stopping Chokidar from watching them as well. Moving the files out of Dropbox fixed immediately (might be worth a try if anyone is hosting the source in DB or any other syncing application).

I'm also using Dropbox (https://github.com/remy/nodemon/issues/749#issuecomment-208158367). This still seems like a bug; multiple things should be able to watch the same files.

@pixelventures +1, Dropbox seems to be the issue in this case, will try to ping them to find out what would be the implications of allowing other processes to watch files, for now don't use Dropbox if you want to have auto-refresh. 馃槩

Interestingly it wasn't working for me because the folder where my repos are had ".git" in the name (Dev.git-repos/repository1). So be careful with the name of the folder where you put your repos as well.

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

Autoclosing issues, even via bot, is very user-hostile.

@ljharb my bots are covered in fluffy overcoats and carry emojis inside their metal shells. All user hostels will remain open and welcome.

At the same time, I've got 280 open issues and I can't get a handle on them at all - so I had to do something. There's no "close all issues at once and pretend like it's okay until more comments come in" feature in github.

More context for folks: a lot of these issues have sprawled into multiple issues with similar symptoms (and this is because I've not had the capacity to keep on top of the issues), so it's unclear what's an issue or not.

Anyway, I'm guessing this is still an issue. I wonder if a test case could help narrow this down (rather than downgrading)?

Can anyone who has had this issue say whether #916 is the same issue? If so, I'll mark and close one as a duplicate issue in the hope that it can be narrowed down and fixed.

916 is definitely the issue that I was having, not sure if it's the issue that OP was having.

I do believe this is the same as #916 - nodemon is being run inside a folder which has node_modules a couple of levels up the path, i.e. the overarching theme is that if the parent folder contains a name which is ignored by default - all changes are ignored.

I had the same problem on nodemon 1.12.5.
Mac OS 10.13.1, [email protected], [email protected], No dropbox installed, No 'git' string in directory name and project name
but folder i work named 'Admin beta (system)'

Upgrade to nodemon 1.4.1 solved then problem

Small note: If you have node_modules somewhere in the path this happens also.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

fabianMendez picture fabianMendez  路  4Comments

dimsmol picture dimsmol  路  4Comments

Bastorx picture Bastorx  路  5Comments

jagged3dge picture jagged3dge  路  4Comments

remy picture remy  路  5Comments