remy / nodemon Goto Github PK
View Code? Open in Web Editor NEWMonitor for any changes in your node.js application and automatically restart the server - perfect for development
Home Page: http://nodemon.io/
License: MIT License
Monitor for any changes in your node.js application and automatically restart the server - perfect for development
Home Page: http://nodemon.io/
License: MIT License
Hi, I used to use supervisor but it don't support ignore feature (although it is in pull request) so many suggested me to use nodemon with .nodemonignore
file but I wonder how I could make nodemon to monitor for coffee and jade extensions too... with supervisor I used to do NODE_ENV=development supervisor -e "node|js|coffee|jade" app.js
how I could so something similar with nodemon?
Thanks a lot :)
When trying to run nodemon with node version 0.6.9, the application would spit out the help as though no arguments were being passed.
By reverting my windows installation of Node from latest (0.6.9) to 0.6.8 I was able to get it to run without issue.
I get the following error when i added a .nodemonignore file:
2 Feb 19:10:13 - [nodemon] reading ignore list
2 Feb 19:10:13 - [nodemon] exception in nodemon killing node
Error: use fs.watch api instead
at Object.watchFile (fs.js:734:11)
at C:\Users\...\AppData\Roaming\npm\node_modules\nodemon\nodemon.js:179:8
at Object.oncomplete (path.js:406:19)
Seems to be fixed by changing line 179:
fs.watchFile(ignoreFilePath, { persistent: false }, readIgnoreFile);
to
fs.watch(ignoreFilePath, { persistent: false }, readIgnoreFile);
P.S. seems to skip ignore file read completely when trying to use old-style nodemon-ignore file (cannot create files starting with a dot in Windows Explorer so tried the old style).
I use node v0.4.8 and nodemon v0.5.0. For that you can replay my issue, I have created this repository:
https://github.com/akidee/nodemon_issue
Type:
nodemon index.js go &
Does not work on both Debian and Mac OS.
Steps to reproduce:
Libs:
nodemon 0.6.7
nodejs v0.6.9
coffee-script 1.2.0
PS:
After fixing this issues I plan to use nodemon with https://github.com/dannycoates/node-inspector
Issue reproduces without using node-inspector
I don't know if there is a way to use .coffee with nodemon, but it would be nice to run CoffeeScripts with it as well (if it isn't already)!
I'm not sure if this was intentional or not, but it appears that having a .nodemonignore file is required for the service to work. Before I added the ignore file my app would startup but wouldn't restart when files changed. Once I added an ignore file, everything works as expected. If you really do need a .nodemonignore file then the docs should be updated to say that.
Hi,
I tried to monitor my markdown file (REAME.md) to build automatically a pdf file
nodemon --exec "pandoc -o out.pdf" README.md
but nodemon (node) uses 40% of my cpu while idling.
Is this normal?
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
I'm trying to pass the arguments --nodejs --debug
to coffee-script through nodemon. This is what I write:
nodemon --nodejs --debug -w src -x coffee src/server.coffee
It should work, but unfortunately nodemon is passing the arguments to coffee in the wrong order, giving me this error:
$ nodemon --nodejs --debug -w src -x coffee src/server.coffee 15 Jan 03:47:10 - [nodemon] v0.6.5 15 Jan 03:47:10 - [nodemon] watching: /root/projects/honstreams/server/src 15 Jan 03:47:10 - [nodemon] running --debug 15 Jan 03:47:10 - [nodemon] starting `coffee --debug --nodejs src/server.coffee` node.js:201 throw e; // process.nextTick error, or 'error' event on first tick ^ Error: unrecognized option: --debug ...
Coffee-script doesn't recognize the option --debug
. The option --nodejs
should come first, so coffee script knows to send the following arguments to node.
4 Jan 23:56:21 - [nodemon] v0.5.7
4 Jan 23:56:21 - [nodemon] watching: D:\node.js
4 Jan 23:56:21 - [nodemon] running app.js
4 Jan 23:56:21 - [nodemon] starting node
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: No such module
at EventEmitter. (node.js:386:27)
at Object. (C:\Users\Thomas\AppData\Roaming\npm\node_modules\node
mon\nodemon.js:286:9)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
is it possible to not exit nodemon if an error happens?
this would be really awesome if you could save errors see the error and keep editing without having to touch the shell and restart...
It might be useful if Nodemon would pass SIGINT, etc. to the child process. Sometimes one might want to setup event handlers for various process signals. At present, I believe that Nodemon simply sends SIGTERM to the child process.
nodemon no longer works under node 0.6
Hi, i was trying to install nodemon to use node.js following this tutorial http://shapeshed.com/journal/creating-a-basic-site-with-node-and-express/ and in the nodemon part, I had this error
$ npm install nodemon -g
npm ERR! Could not create /usr/lib/node_modules/___nodemon.npm
npm ERR! error installing [email protected] Error: EACCES, Permission denied '/usr/lib/node_modules/___nodemon.npm'
npm ERR! Error: EACCES, Permission denied '/usr/lib/node_modules/___nodemon.npm'
npm ERR! Report this entire log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]
npm ERR!
npm ERR! System Darwin 11.2.0
npm ERR! command "node" "/usr/bin/npm" "install" "nodemon" "-g"
npm ERR! cwd /Users/nododiseno/node/npm/SitioEjemplo
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.103
npm ERR! path /usr/lib/node_modules/___nodemon.npm
npm ERR! code EACCES
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /Users/nododiseno/node/npm/SitioEjemplo/npm-debug.log
npm not ok
I haven't found any solution on the forums or any other place
Hope you can help me please
Many other 'meta' files that are generated by IDEs and tools like git/mercurial, are .hidden by default, as they aren't actually part of the project, they're part of the files supporting the project.
To keep a degree of consistency with these other systems, and so I can easily cluster all of my meta files together/hide them, it'd be good if nodemon's ignore file was .nodemonignore by default, dropping the hypen also keeps it consistent with the naming format of .gitignore/.hgignore.
to ensure compatibility with existing projects nodemon could auto-rename 'legacy' nodemon-ignore files to .nodemonignore
I'm using node v0.6.10 on Windows 7 and I can't get nodemon to reload all my files. It seems to ignore everything other than my .jade files. It's certainly not reloading .js files.
What have I got configured incorrectly?
I run nodemon app.js, make a change to app.js, nodemon reloads my app no problem
I run nodemon --debug app.js, make a change to app.js, nodemon doesn't pick up my change and my app doesn't reload.
I'm running node v0.6.6 and nodemon v0.6.3 on Mac OSX Lion
My app is using the Express framework
nodemon can now handle running command line tools on file changes. But it appears that the arguments meant for the cl tool aren't being passed correctly. Example:
buster test
used with nodemon is nodemon buster test
, but it blows up with:
Error: Cannot find module '/javascript/trybuster/test'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
another example that would be easier to replicate:
npm install http-server -g
nodemon http-server /javascript/nodemon
(a folder to serve up with http-server)
blows up with:
Error: Cannot find module '/javascript/nodemon'
at Function._resolveFilename (module.js:334:11)
at Function._load (module.js:279:25)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
11 Jan 10:43:55 - [nodemon] app crashed - waiting for file changes before starting...
I'm running [email protected]
and [email protected]
Steps to repro:
nodemon server.js
Error:
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
TypeError: Cannot call method 'splice' of undefined
at Object. (/usr/lib/node_modules/nodemon/nodemon.js:10:29)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
using:
node -v
v0.6.7
*I am seeing this issue when using nodemon with a project generated from matador ( if this helps )
https://github.com/Obvious/matador
... with a custom prefix (e.g. coffee instead of node)
... with events like 'refresh'
Sytax
nodemon [config.js] ...
if config does not end in js, the default is used.
nodemon .\web.coffee
20 Jan 10:14:35 - [nodemon] v0.6.7
20 Jan 10:14:35 - [nodemon] watching: C:\data\Dropbox\projects\_bit\ET2012_1.coffee\src\tracker
20 Jan 10:14:35 - [nodemon] starting `coffee .\web.coffee`
CreateProcessW: The system cannot find the file specified.
20 Jan 10:14:35 - [nodemon] app crashed - waiting for file changes before starting...
====================
coffee is is in the path, can run it from the command line. nodemon cannot execute it.
This might be a local problem. Any ideas? (All other NPM packages are working correctly.) The path from where it's trying to load the file, looks wrong for NPM 1.0. (I think it's 'node_modules' now.)
Thanks,
Chris.
chris@vostro:~/btl.workspace/ts$ nodemon app.js
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: Cannot find module './../lib/node/.npm/nodemon/0.2.2/package/nodemon'
at Function._resolveFilename (module.js:320:11)
at Function._load (module.js:266:25)
at require (module.js:348:19)
at Object. (/usr/local/bin/[email protected]:11:18)
at Module._compile (module.js:404:26)
at Object..js (module.js:410:10)
at Module.load (module.js:336:31)
at Function._load (module.js:297:12)
at Array. (module.js:423:10)
at EventEmitter._tickCallback (node.js:126:26)
Using node v0.6.0
Using nodemon v0.5.7
When I pass an argument starting with a hyphen it is not passed along, however without the hyphen it does pass that argument to the script. Example:
nodemon app.js -d
results in the following being passed
[node, /path/to/app.js]
While if I enter the following:
nodemon app.js d
the following array is passed
[node, /path/to/app.js, d]
Perhaps I missed something in the documentation?
The lasted version npm made a lot of breaking changes.
One of them seems to be breaking nodemon:
$ nodemon server.js /usr/local/bin/nodemon: line 1: syntax error near unexpected token `(' /usr/local/bin/nodemon: line 1: `var fs = require('fs'),'
This does work:
$ node /usr/local/bin/nodemon server.js
When I launch nodemon on my computer, it reeds .nodemonignore
every 5 seconds:
6 May 17:41:46 - [nodemon] reading ignore list 6 May 17:41:51 - [nodemon] reading ignore list 6 May 17:41:56 - [nodemon] reading ignore list 6 May 17:42:01 - [nodemon] reading ignore list
I've installed it with npm 1.0.3, using npm install nodemon
(0.4.1).
Maybe something else in my system is modifying my file every 5 seconds? _
Could it be related to the fact that I've turned on "FileVault" on my Mac (Mac OS X 10.6.7)?
I just downloaded and tried using nodemon for the first time today. It did not work when passed my .coffee files directly. Looking around a bit I found that the options parser was setting the executable name to 'coffee' under program.exec but using program.options.exec to spawn the process. I changed it so that 'coffee' gets assigned to program.options.exec, and this seems to have worked for me.
Adding multiple files types to .nodemonignore like this:
*.js
*.css
throws an exception and it seems that the reason is the second file types i missing a '.' in the RegExp.
Complete error:
SyntaxError: Invalid regular expression: /\./\.monitor|\./\.nodemonignore|.*\.js|*.css/
at new RegExp (unknown source)
at addIgnoreRule (/usr/local/lib/node_modules/nodemon.js:115:19)
at Array.forEach (native)
at /usr/local/lib/node_modules/nodemon/nodemon.js:137:60
at path.js:292:19
My platform is ubuntu:
Linux Ubuntu-1010-maverick-64-minimal 2.6.35-25-server #44-Ubuntu SMP Fri Jan 21 19:09:14 UTC 2011 x86_64 GNU/Linux
Node version 0.2.6
Nodemon version 0.2.0
Not sure if this is a bug, but any suggestion is appreciated.
Is there a way to monitor any file change recursively?
. . Hi there. Currently I have a very specific setup in the machine running the app I'm working on. Sadly I don't have direct access to the server and I need the app to run as smoothly as possible, but I also need a way to update the code. Since I can't access the server to restart the process, I used forever (in Node.JS) to keep it running.
. . As I needed to update the server frequently, I wrapped the "forever.js" script (that runs my "server.js"--that runs a HTTP and Socket servers) in a nodemon process.
. . The thing is: as I change a file, the nodemon process restart the forever.js, but then the forever.js runs an infinite loop of error/respawn with the following error message:
{ stack: [Getter/Setter],
arguments: undefined,
type: undefined,
message: 'EADDRINUSE, Address already in use',
errno: 98,
code: 'EADDRINUSE',
syscall: 'bind' }
. . If I manually do a Ctrl+C and restart the nodemon command ("nodemon -d 6 forever.js") it start ok again (even when it's in the forever error loop), but as soon as I change a file, my script goes into the "address in use" error loop again. I don't know if nodemon is not actually closing the process and the port bind hangs or something... If you have any tips I would greatly appreciate it.
. . I though about not using the forever.js (running "nodemon -d 6 server.js" rather then "forever.js") because when starting this way the server restarts ok if I save a file, but I really need the forever.js to restart my server automatically if an error occurs because I can't afford the downtime until I manually upload a file again (so that nodemon restart my server).
. . PS: it is worth mentioning that my server restarts ok when an error occurs if I run "node forever.js" directly, without "nodemon", so the problem seems to be using both of them together.
. . Do you have any tips?
I can't run nodemon on the simplest node.js app, i get this error:
$ nodemon main.js
17 Dec 16:29:11 - [nodemon] v0.5.7
17 Dec 16:29:11 - [nodemon] watching: /media/Datos/j0hn/Code/js/node/simple
17 Dec 16:29:11 - [nodemon] running main.js
17 Dec 16:29:11 - [nodemon] starting node
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: UNKNOWN, unknown error './.monitor'
at Object.chmodSync (fs.js:509:18)
at Object.<anonymous> (/usr/lib/node_modules/nodemon/nodemon.js:277:4)
at Module._compile (module.js:432:26)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
zsh: exit 1 nodemon main.js
$
the content of main.js it's just:
var http = require("http");
var server = http.createServer(function(req, res){
res.writeHead(200);
res.end("hhelllaskd asdi o");
});
server.listen(8080);
My version of node it's 0.6.6 and the version of nodemon 0.5.7 and i've installed nodemon from npm.
Any clue on how to get this working?
When editing file and uploading that back through FTP, nodemon recognizes the change and keeps restarting forever
unless I explicitly do touch filename
It appears the reason for this is fs.watchFile will fire on any access of a file.
From Node.js API docs
Watch for changes on filename. The callback listener will be called each time the file is accessed.
At the end it then says
If you want to be notified when the file was modified, not just accessed you need to compare curr.mtime and `prev.mtime.
change
function readIgnoreFile() {
to
function readIgnoreFile(curr, prev) {
then add
if(curr && prev && curr.mtime.valueOf() === prev.mtime.valueOf()) return;
This could be related to #23 but is definitely its own issue, tested without anything else access the contents of the directory.
After leaving nodemon running for a long time, it will exit with a message about "abort trap 6" and crash (I'm running OSX 10.7.2).
After this happens, the child process is still running, and I'm forced to kill it before re-running nodemon (because the port can't be bound).
Is there any way to either restart nodemon automatically, or at least to kill the child process in this instance?
having main in package.json in a subdirectory fails to run properly.
"main": "bin/server.js"
causes nodemon to attempt to run bin/server.js
from within the bin
directory causing an attempt to really run {app_dir}/bin/bin/server.js
this fails also trying just server.js
or ./bin/server.js
"nodemon app.coffee" doesn't result in a server restart when making changes to the app.coffee file.
A simple short for lazy developers - if no command line arguments and package.json exist then use the main property.
EDIT: was use index.js
Is it possible to add support for --debug-brk? Thanks
It would be nice to have an optional command line argument to adjust the checking interval for changed files.
E.g. check for file changes only every 10 seconds, so the app doesn't get restarted in the middle of a FTP upload when replacing some application files while the process is running.
$ nodemon --delay 1 index.js go
25 May 00:17:13 - [nodemon] Adding delay of 1 seconds
usage: nodemon [options] [script.js] [args]
e.g.: nodemon script.js localhost 8080
Options:
--js monitor only JavaScript file changes
(default if ignore file not found)
-d n, --delay n throttle restart for "n" seconds
--debug enable node's native debug port
-v, --version current nodemon version
-h, --help this usage
Note: if the script is omitted, nodemon will try "main" from package.json
For more details see http://github.com/remy/nodemon/
Instead of starting the script, I get help.
On Snowleopard, this I'm getting this:
bash-3.2$ nodemon
/usr/local/bin/nodemon: line 1: syntax error near unexpected token `('
/usr/local/bin/nodemon: line 1: `var fs = require('fs'),'
bash-3.2$ node -v
v0.4.1
Maybe I am missing something, but when I use kill on the nodemon process, the child process hangs out there. Nodemon does not send any SIGTERM signal to the child process.
How to duplicate:
When I run nodemon app.coffee
, I get the following error:
$ nodemon app.coffee
18 Jan 12:06:59 - [nodemon] v0.6.6
18 Jan 12:06:59 - [nodemon] watching: /Users/dave/Sites/test
18 Jan 12:06:59 - [nodemon] starting `node app.coffee`
/Users/dave/Sites/test/app.coffee:1
# My app
^
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^
SyntaxError: Unexpected token ILLEGAL
at Module._compile (module.js:427:25)
at Object..js (module.js:450:10)
at Module.load (module.js:351:31)
at Function._load (module.js:310:12)
at Array.0 (module.js:470:10)
at EventEmitter._tickCallback (node.js:192:40)
18 Jan 12:06:59 - [nodemon] app crashed - waiting for file changes before starting...
Obviously it looks like it's executing the CoffeeScript as raw js rather than CoffeeScript. I'm using nodemon 0.6.6.
Can you get it to follow symbolic links and look for changes in those, or subfolder/files as well?
I love nodemon; it rocks! Makes developing with node.js so much easier.
Is there a way to use nodemon with a command-line node tools? For example I run my node tests by invoking buster test
. It would be neat to have that run every time my code changes, using nodemon.
export PATH="$HOME/you/node/folder:$PATH"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.