Getting Started with Node.js on a Mac
Getting Started with Node.js on a Mac
In a few short steps you can easily get NodeJS running on your Mac
Join the DZone community and get the full member experience.
Join For FreeJumpstart your Angular applications with Indigo.Design, a unified platform for visual design, UX prototyping, code generation, and app development.
This is the OS I am running my mac on.
$ sw_vers -productVersion
10.10.2
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
v0.12.6
$ npm -v
2.11.2
The installed stuff are at /usr/local/bin
$ pwd
/usr/local/bin
$ 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, '127.0.0.1');
console.log('Server running at http://127.0.0.1:1337/');
References
Take a look at an Indigo.Design sample application to learn more about how apps are created with design to code software.
Published at DZone with permission of Partha Bhattacharjee , DZone MVB. See the original article here.
Opinions expressed by DZone contributors are their own.
{{ parent.title || parent.header.title}}
{{ parent.tldr }}
{{ parent.linkDescription }}
{{ parent.urlSource.name }}