I am trying to follow the following the tutorial The Node Beginner Book
I have installed node and mongodb successfully, when i do node -v
it gives me v0.5.11-pre
but when i save the file say hello.js
in Home/node/
and write node hello.js
in the terminal it gives me the following error
ubuntu@ubuntu:~/Downloads$ node hello.js
node.js:201
throw e; // process.nextTick error, or 'error' event on first tick
^ Error: Cannot find module '/home/ubuntu/Downloads/hello.js'
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)
Please help me find what I am doing wrong here. I'm using Ubuntu in a virtual machine.
You're in the wrong directory. Move to the file where hello.js
is with cd
, like this:
cd $HOME/node
node hello.js