Getting Started with Node.js

Getting Node.js

There are different ways of getting Node.js:

  1. Downloading installers or binaries
    • https://nodejs.org/en/download/
  2. Build from source code
  3. For OSX and Linux environment, manage multiple version using nvm tool
    • We will be installing Node.js using the nvm tool for OSX

Installing Node Version Manager nvm tool

$ git clone https://github.com/creationix/nvm.git ~/nvm
$ . ~/nvm/nvm.sh
$ nvm

Installing Node.js using nvm tool

$ nvm install v4.4.2
$ nvm install v5.10.1
$ nvm ls
$ node -v
$ nvm use v4.2.2
$ nvm alias default v5.10.1
$ node
> console.log("Node Intro");
Hello World
undefined
>
(^C again to quit)
>
##

Running a simple web server

comments powered by Disqus