Over a million developers have joined DZone.

Getting Started with Node.js on a Mac

DZone's Guide to

Getting Started with Node.js on a Mac

In a few short steps you can easily get NodeJS running on your Mac

Free Resource

Discover how to focus on operators for Reactive Programming and how they are essential to react to data in your application.  Brought to you in partnership with Wakanda

This is the OS I am running my mac on.

$ sw_vers -productVersion 

Install from https://nodejs.org. Just click on download, wait till done, click and follow the installation wizard. Once done, open the terminal and check if the versions are alright.

$ node -v 
$ npm -v 

The installed stuff are at /usr/local/bin

$ pwd 
$ ls -lh 
total 70416
-rwxr-xr-x  1 root  admin    34M Jul  4 06:10 node
lrwxr-xr-x  1 root  admin    38B Jul  4 22:12 npm -> ../lib/node_modules/npm/bin/npm-cli.js

Run the hello world.

var http = require('http');
http.createServer(function (req, res) {
  res.writeHead(200, {'Content-Type': 'text/plain'});
  res.end('Hello World\n');
}).listen(1337, '');
console.log('Server running at');


  1. https://nodejs.org 
  2. http://blog.ijasoneverett.com/2013/03/getting-started-with-node-js-on-mac-os-x/

Learn how divergent branches can appear in your repository and how to better understand why they are called “branches".  Brought to you in partnership with Wakanda

nodejs ,mac osx

Published at DZone with permission of Partha Bhattacharjee, DZone MVB. See the original article here.

Opinions expressed by DZone contributors are their own.


Dev Resources & Solutions Straight to Your Inbox

Thanks for subscribing!

Awesome! Check your inbox to verify your email so you can start receiving the latest in tech news and resources.


{{ parent.title || parent.header.title}}

{{ parent.tldr }}

{{ parent.urlSource.name }}