Node.js is a platform for easily building fast, scalable network applications.
Download the archive from here.
Unarchive and you can use it.
1 2 3 | [free-tutorials@free-tutorials ~]$ cd node-v0.10.10-linux-x86/ [free-tutorials@free-tutorials node-v0.10.10-linux-x86]$ ls bin ChangeLog lib LICENSE README.md share |
The nodemon can be used during the development of a node.js based application.
How? will watch the files in the directory that nodemon was started.
Also, it will automatically restart your node application if it’s some changes.
Using nodemode is very easy.
You need to install nodemode using npm.
1 2 3 4 5 6 7 8 9 10 | [free-tutorials@free-tutorials bin]$ ./npm install -g nodemon npm http GET https://registry.npmjs.org/nodemon npm http 200 https://registry.npmjs.org/nodemon npm http GET https://registry.npmjs.org/nodemon/-/nodemon-0.7.8.tgz npm http 200 https://registry.npmjs.org/nodemon/-/nodemon-0.7.8.tgz /home/free-tutorials/node-v0.10.10-linux-x86/bin/nodemon -> /home/free-tutorials/node-v0.10.10-linux-x86/lib/node_modules/nodemon/nodemon.js npm WARN package.json github-url-from-git@1.1.1 No repository field. npm WARN package.json assert-plus@0.1.2 No repository field. npm WARN package.json ctype@0.5.2 No repository field. nodemon@0.7.8 /home/free-tutorials/node-v0.10.10-linux-x86/lib/node_modules/nodemon |
Now nodemon will be installed into your bin path.
If you got some errors about: /usr/bin/env node then you need to add the module.
Add your node_modules to the PATH.
1 | $ export=./node_modules/:.bin |
if you use the folder in your home account then edit .bashrc and add this:
1 | export PATH=$PATH:/home/YOUR_USER/node-v0.10.10-linux-x86/bin |
or maybe you can try :
1 2 3 | echo 'export PATH=$HOME/local/node/bin:$PATH' >> ~/.profile echo 'export NODE_PATH=$HOME/local/node:$HOME/local/node/lib/node_modules' >> ~/.profile source ~/.profile |
See my examples. In my bin node folder and I add to the PATH:
1 2 3 4 5 6 7 8 9 10 11 12 | usertest@home:~/node-v0.10.13-linux-x86/bin$ export PATH=$PATH:/home/usertest/node-v0.10.13-linux-x86/bin usertest@home:~/node-v0.10.13-linux-x86/bin$ ls node nodemon npm usertest@home:~/node-v0.10.13-linux-x86/bin$ echo $PATH /usr/lib/i386-linux-gnu/libfm:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/usr/games:/home/usertest/node-v0.10.10-linux-x86/bin:/home/usertest/node-v0.10.13-linux-x86/bin usertest@home:~/node-v0.10.13-linux-x86/bin$ ./node node nodemon usertest@home:~/node-v0.10.13-linux-x86/bin$ ./nodemon 24 Jul 23:25:37 - [nodemon] v0.7.8 24 Jul 23:25:37 - [nodemon] to restart at any time, enter `rs` 24 Jul 23:25:37 - [nodemon] watching: /home/usertest/node-v0.10.13-linux-x86/bin 24 Jul 23:25:37 - [nodemon] starting `node ` |
Try the nodemon module.
1 2 3 4 5 6 7 | [free-tutorials@free-tutorials bin]$ ./nodemon serv.js 8 Jun 18:54:42 - [nodemon] v0.7.8 8 Jun 18:54:42 - [nodemon] to restart at any time, enter `rs` 8 Jun 18:54:42 - [nodemon] watching: /home/free-tutorials/node-v0.10.10-linux-x86/bin 8 Jun 18:54:42 - [nodemon] starting `node serv.js` { bar: 'foobar' } Hello World, this is my object: {"bar":"foobar"} |
For more information, take a look at the documentation here.