Last Updated: February 25, 2016
·
4.42K
· zaus

How to use Nodemon on Nitrous.io

For easier Node.js development, tools like nodemon are great, but how do we use it on Nitrous.io?

  1. Install using npm: $ npm install -g nodemon
  2. Run app with $ nodemon -L myapp.js rather than $ node myapp.js
  3. Monitor multiple directories: $ nodemon -L --watch ~/workspace/mylib --watch libs app/server.js

The trick, as pointed out by the helpful support team at Nitrous.io, is that their filesystem does not yet fully support the inotify interface, which fs.watch and nodemon use to detect changes. Fortunately, nodemon's author @remy thought of this and provided a legacy flag -L, which allows it to work on Nitrous.io.

What are you talking about?

nodemon is an "app wrapper" that monitors file changes in your Node.js project to automatically restart the node server. Very flexible, can monitor single files or multiple directories. Only change to your development process is to start a node app with the console command $ nodemon myfile.js rather than $node myfile.js.

Nitrous.io is a web-based development IDE+environment (development-as-a-service? DaaS?) that lets you write and deploy code (Ruby, Node.js, Django, Go) in an actual environment, all from your browser.