Install NodeJS
To install and use multiple versions of nodejs on same machine, click here
Windows
- Go to link https://nodejs.org/en/download
- Page will display options to download LTS version (this is the latest stable version of nodejs).
- Look for appropriate version as per your OS (32/64 bit).
- Choose .msi OR .zip file and click to download.
- Once downloaded, unzip the zip file (for installation using .msi skip this step).
- zip file will extract all files and can be used directly without any installtion. Update your PATH environment variable to add the location, where you keep all unzipped files.
- If you downloaded .msi, click on the file to install and follow simple installation steps.
- This will install node and npm on the machine. npm is node package manager, used for download and install any module.
- Check the version of node and npm using below commands:-
node -v
npm -v
Ubuntu
Add specific version (e.g. 12.x here) in repository and install using apt-get
curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt-get install -y nodejs
If we do not have root access, we can download and untar nodejs tar file and use it
curl -o node-v12.18.0-linux-x64.tar.xz "https://nodejs.org/dist/v12.18.0/node-v12.18.0-linux-x64.tar.xz"
tar -xvf node-v12.18.0-linux-x64.tar.xz
Now add the path of above untar file (with ./bin path) to PATH environment variable.
Linux
If we do not have root access, we can download and untar nodejs tar file to use it
curl -o node-v12.18.0-linux-x64.tar.xz "https://nodejs.org/dist/v12.18.0/node-v12.18.0-linux-x64.tar.xz"
tar -xvf node-v12.18.0-linux-x64.tar.xz
Now add the path of above untar file (with ./bin path) to PATH environment variable.