Blog

How to install Node.js and npm

Meta avatar Mario Romano   11. June, 2016
Let's start with 2 lines of what is npm and Node.js, but if you already know about them you can jump directly to the section on how to install it.

What is Node.js

Node.js is a JavaScript open-source, cross-platform runtime built on Chrome's V8 JavaScript engine. If you are a java developer, Node.js is the equivalent of the JVM for the JavaScript world.

What is npm

Npm is the package manager for NodeJS and is also the largest repository of open source libraries in the world. if you are a java developer npm is the equivalent of Maven Central for the JavaScript world. As its name would imply, you can use it to install node programs and distribute your packages.

How to install it

If you don't know if you have npm and Node.Js installed, run the following commands in your terminal to check it:
                
    node -v in
    npm -v
                
              
If you don't have Node.js and npm and you are using OS X or Windows download it from here: https://nodejs .org/en/download/.

Mac users can also use brew :
                
    brew install node
                
              
Linux users can use apt-get:
                
    curl -sL https://deb.nodesource.com/setup_5.x | sudo -E bash -
    sudo apt-get install -y nodejs