node-dev
Zero-conf Node.js reloading
I've got small problem with node-dev. I installed it accordingly to directions in readme, and it runs when I type command for example: node-dev somescript.js, but it runs only once, just like I used node without -dev. There is no restart when I change code, and it immediately kicks me back to command line after execution. Has anybody been in this situation, and/or knows solution?
Source: (StackOverflow)
Is there a way to toggle restarting nodejs for only certain files using node-dev or the like?
I've looked and it seems require.extensions is an object that holds the extensions in which to restart for, though deleting it doesn't seem to do anything.
What I want is to be able to use node-dev as usual, but have certain files be required without restarting, so I can watch them manually and reload them without restarting everything.
Source: (StackOverflow)
How would I go about logging (kind of like tail -f) every request using node-dev so that I am able to see which route is being hit, etc?
Source: (StackOverflow)
I have just started learning node.js and found about node-dev. When I run a simple hello world script using node-dev I get the following error:
$ node-dev script.js
node.js:762
throw errnoException(process._errno, 'uv_signal_start');
^
Error: uv_signal_start EINVAL
at errnoException (node.js:540:13)
at process.on.process.addListener (node.js:762:17)
at spawn.cwd (/usr/local/lib/node_modules/node-dev/node-dev:52:11)
at Array.forEach (native)
at Object.<anonymous> (/usr/local/lib/node_modules/node-dev/node-dev:51:25)
at Module._compile (module.js:456:26)
at Object.Module._extensions..js (module.js:474:10)
at Module.load (module.js:356:32)
at Function.Module._load (module.js:312:12)
at Function.Module.runMain (module.js:497:10)
There are some questions tagged to node-dev but none of them have any solution. It would be great if anyone can point me to the right direction to solve this problem.
OS and Node Versions
OS: Ubuntu 12.04
node: 0.10.22
node-dev: 2.1.4
filewatcher: 1.0.0
growl: 1.7.0
Source: (StackOverflow)
So that I don't have to keep restarting node.js during development I'm trying to use node-dev. Unfortunately, when I try to run node-dev from terminal I receive the error:
$ node-dev server.js
-bash: node-dev: command not found
I have globally installed node-dev via the npm install node-dev -g
command. The output from this command is:
npm http GET https://registry.npmjs.org/node-dev
npm http 304 https://registry.npmjs.org/node-dev
npm http GET https://registry.npmjs.org/growl
npm http 304 https://registry.npmjs.org/growl
/usr/local/share/npm/bin/node-dev -> /usr/local/share/npm/lib/node_modules/node-dev/node-dev
node-dev@0.2.9 /usr/local/share/npm/lib/node_modules/node-dev
└── growl@1.6.1
To be sure node-dev is installed globally I've run npm ls -g
which returns:
/usr/local/share/npm/lib
└─┬ node-dev@0.2.9
└── growl@1.6.1
Some other posts have indicated that my globally installed npm modules should be in the /usr/local/lib/node_modules
folder instead of /usr/local/share/npm/lib/
. I can't tell if this is for older versions of npm or something that actually matters.
I'm new to both Mac OS X and Node development so it wouldn't surprise me that I was overlooking something trivial. What haven't I done which is causing me to get a "command not found" error when trying to utilize node-dev? Is there some sort of $PATH environment issue I'm overlooking?
One note I don't have Growl installed but the node-dev documentation indicated it was optional.
Source: (StackOverflow)
I am new to nodejs and i am trying to run the following command
sudo npm install node-dev -g
I get the following message
npm WARN deprecated object-keys@0.2.0: Please update to the latest object-keys
/usr/local/bin/node-dev -> /usr/local/lib/node_modules/node-dev/bin/node-dev
node-dev@2.6.2 /usr/local/lib/node_modules/node-dev
├── filewatcher@1.1.2
├── resolve@1.1.6
├── dynamic-dedupe@0.2.0 (xtend@2.0.6)
├── dateformat@1.0.11 (get-stdin@4.0.1, meow@3.1.0)
└── node-notifier@4.2.1 (shellwords@0.1.0, clone@0.1.19, growly@1.2.0, minimist@1.1.1, semver@4.3.6, cli-usage@0.1.1, which@1.1.1)
And then when i do
node-dev demo2.js
the javascript file does not run continuously. Can anyone help me with this ? I want to run the file continuously with node-dev
Source: (StackOverflow)
I am developing Node.js application using Node-dev. Each time I save the script of the application (press Control-S) node-dev will restart my app. Now the question, can I detect the restart withing the application, so that I can save some data before the program is terminated?
process.on('SIGINT', function() {
console.log('SIGINT');
});
The code above does not detect this kind of restart.
I am using Windows XP.
Source: (StackOverflow)