Giter Site home page Giter Site logo

Sub Directories about nodemon HOT 19 CLOSED

tylorr avatar tylorr commented on August 17, 2024
Sub Directories

from nodemon.

Comments (19)

pencilcheck avatar pencilcheck commented on August 17, 2024 1

The server didn't restart when I edit one of the file in a subfolder. I'm on the latest version

from nodemon.

Hulkmaster avatar Hulkmaster commented on August 17, 2024 1

achieved with **/*.less

full command i use
nodemon --watch **/*.less --ext less --exec 'npm run build-less'

from nodemon.

remy avatar remy commented on August 17, 2024

Which platform are you running under?

Due to a bug in node on windows it now means there's two different methods to watching for change.

Sent from my iPhone

On 15 Feb 2012, at 09:22, Tylor Reynolds [email protected] wrote:

I running into an issue where nodemon is not restarting my app when any files in sub-directories are changed.

I am running a socketstream app
I call nodemon using the following command: sudo nodmon app.js

The server only restarts if I change root files

I can get the server to restart if I add watches to the command

sudo nodemon -w . -w server/rpc/ app.js

Now it will listen to changes in the root folder and the server/rpc/ folder


Reply to this email directly or view it on GitHub:
#66

from nodemon.

tylorr avatar tylorr commented on August 17, 2024

I am running Ubuntu Server 10.04

from nodemon.

tylorr avatar tylorr commented on August 17, 2024

I wanted to figure out how to do recursive file watches so I came up with this:

var fs   = require('fs');

var callback = function(event, filename) {
  console.log(event, filename);
};

var watch = function(file, real) {
  var path;  
  if (!real) {
    real = fs.realpathSync(file);
    path = real;
  } else {
    path = real.concat("/", file);
  }
  real = path;
  var stat = fs.statSync(path);
  if (stat.isDirectory()) {
    fs.watch(path, callback);
    var files = fs.readdirSync(path);
    for (var _i = 0, _len = files.length; _i < _len; _i++) {
      var file = files[_i];
      watch(file, real);
    }
  }
};

watch(".");

from nodemon.

remy avatar remy commented on August 17, 2024

I've actually got the recursive bit in the previous commit of code (before I whipped it out).

Gimme an hour or so and I'll have the fix live. Gotta give it a decent test (now that windows in the scene it slows me down a little :)

On 15 Feb 2012, at 11:08, Tylor Reynolds wrote:

I wanted to figure out how to do recursive file watches so I came up with this:

var fs   = require('fs');

var callback = function(event, filename) {
 console.log(event, filename);
};

var watch = function(file, real) {
 var path;  
 if (!real) {
   real = fs.realpathSync(file);
   path = real;
 } else {
   path = real.concat("/", file);
 }
 real = path;
 var stat = fs.statSync(path);
 if (stat.isDirectory()) {
   fs.watch(path, callback);
   var files = fs.readdirSync(path);
   for (var _i = 0, _len = files.length; _i < _len; _i++) {
     var file = files[_i];
     watch(file, real);
   }
 }
};

watch(".");

Reply to this email directly or view it on GitHub:
#66 (comment)

from nodemon.

porkchop avatar porkchop commented on August 17, 2024

Hi remy. I have the same problem with changes to files in subdirectories not being detected. I reverted to 0.5.7 and the problem went away. Using Ubuntu 11.10

from nodemon.

remy avatar remy commented on August 17, 2024

I'm about to push a fix for this - it'll be in 0.6.10 of nodemon.

from nodemon.

oal avatar oal commented on August 17, 2024

Hey. I'm also working on a Socketstream app. Nodemon restarts when files are changed in /server, but not in /server/rpc, or any other subdirectory more than one level deep. Following @porkchop's advice, I was able to get it working with 0.5.7.

I'm also on Ubuntu Server 11.10.

from nodemon.

acidjazz avatar acidjazz commented on August 17, 2024

Having the same issue.. latest ubuntu server. nodemon ignores outside of the root folder

from nodemon.

maxvipon avatar maxvipon commented on August 17, 2024

And the same on Win 7 x64 (node 0.8.16, nodemon 0.6.23) for me… Restarts only .js are changed in root.

from nodemon.

jdavisclark avatar jdavisclark commented on August 17, 2024

same issue on ubuntu 12.10, node v0.10.3, nodemon v0.7.6.

nodemon --watch lib --watch web web/app.js $1

from nodemon.

georgewilde avatar georgewilde commented on August 17, 2024

Hi, I appear to be having this same issue after upgrading Ubuntu to version 14.10.
I have nodemon 1.2.1 installed and it is restarting correctly when a file in the root folder is changed but anything in a subfolder is ignored.

I realise this issue is closed, would you like me to start a new issue for this or just leave it here?

from nodemon.

acidjazz avatar acidjazz commented on August 17, 2024

@remy @georgewilde can we re-open this and check it out?

from nodemon.

remy avatar remy commented on August 17, 2024

Please include full output with DEBUG=nodemon,nodemon:* in your environment. Otherwise I have no information at all to debug with.

from nodemon.

rabeesh avatar rabeesh commented on August 17, 2024

@remy Same issue happens for me in Ubuntu 14.04.3 LTS, and nodemon v1.4.0

from nodemon.

jonataswalker avatar jonataswalker commented on August 17, 2024

If I include --ext scss (obvious, this can be anything else) then I have it fired on subdirectory.

from nodemon.

Hulkmaster avatar Hulkmaster commented on August 17, 2024

got the same issue
--ext doesnt help

from nodemon.

faraazahmad avatar faraazahmad commented on August 17, 2024

It says it's watching in app/**/* but doesn't restart when changes are made in files that are 2 levels deep.

> [email protected] start /home/faraaz/oss/going
> nodemon --watch app/ --exec ./bin/www

[nodemon] 1.18.4
[nodemon] to restart at any time, enter `rs`
[nodemon] watching: /home/faraaz/oss/going/app/**/*
[nodemon] starting `./bin/www`

from nodemon.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.