Installing node.js on Mac OSX
I recently installed node.js on a Mac running OSX 10.7.2 and these were the steps I followed at the command line. Git and Xcode were already installed on the machine so this assumes they are already present.
- git clone git://github.com/ry/node.git
- cd node
- ./configure
- make
- sudo make install
You can test that node is installed by running a simple program such as:
var http = require('http');
http.createServer(function (request, response) {
response.writeHead(200, {'Content-Type': 'text/plain'});
response.end('Node.js has arrived.\n');
}).listen(1337, "127.0.0.1");
console.log('Up and running at http://127.0.0.1:1337/');
You can run this code by saving it as something like testing-node.js and then entering the command:
node testin-node.js
That’s it. Node.js is now up and running on port 1337 !
PS: stop the server with ctrl + c

Hi,
Great article. Really helped a lot. Please explain more in detail about
1 ./configure & make commands. I would like to know what they do.
2. Is there any specific folder that node likes to read the js file off of ? or can I have js files anywhere and just run “node” command from that directory?
Thank you,
Harish