What is NODE js & Install NODE js on linux using terminal

NODE js :
Node.js is an open source, cross-platform runtime environment built on Chrome's V8 JavaScript engine for server-side and networking applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient. Node.js applications are written in JavaScript.



Basic two ways to install node on linux --

1.  Run the command 
Step 1: curl --silent --location https://deb.nodesource.com/setup_0.12 | sudo bash -
Step 2: sudo apt-get install --y nodejs

2. By using nvm :

=> RUN the command :
curl https://raw.githubusercontent.com/creationix/nvm/v0.11.1/install.sh | bash

nvm will be installed. and you will ask to close and reopen your terminal to start using NVM or you can acheived so by using this command :
source ~/.profile

And now you can use, nvm ls-remote.
If you have error, -bash: nvm: command not found, then install git by using apt-get install git

The nvm ls-remote will show all the versions of node, to install any listed version use nvm install version_name like nvm install 0.10.13

Now, if node is installed, type node --version to see the node version installed.

And, in future if you want to use another node version just type nvm install version_name
to install and then it will be switched to this new version.

If you later, switch to back to previous version just use nvm use version_name 
To see the node path type which node

npm is by default installed, on installing NODE js
* The main reason for installing NODE by using NVM, is that it provide the switching capabilities among different versions

Comments

Popular posts from this blog

What the hack is Call, bind & apply

What is MQTT protocol & its use

What is Provider in Angular Js?