How to install Node.js with NPM on Windows and Ubuntu ? - AkuCode

Installing Node. JS on Windows
Step 1: Download Node.js
To Download Node.js I use Windows Installer (.msi) 64-bit. The download Link Node.js is on the official Node.js website:

Pictures 2.1.0

Step 2 : Install Node.js
·       After the Download finishes running the Node. JS Installer (.msi) file

Pictures 2.1.1

Pictures 2.1.2
2. Choose the directory to save Node.js

Pictures 2.2
1.     When you arrived at Custom Step readers understand how well that the Node. JS Installer performs the automatic setup of Path NPM/Node in the Windows environment variable.

Pictures 2.3
4. Next, Then select Install and Run Administrator

Pictures 2.4
5. Wait until the installation is complete and press Finish.

Pictures 2.5
6. Check Installation Node.JS
        For check installation Node. JS is installed perfectly in Windows, the reader just simply open the CMD (Command Line) Windows and type in the command Node-V # or npm
Then Enter, as the following figure:

Pictures 2.6
If the command result is like the above view, then the installation of Node.js is successful.

Install Node.js and NPM from Ubuntu Official Repository
The easiest and fastest way to install Nodejs Ubuntu 18.04 is through Ubuntu's official repository.
·       Establish a connection to the server using SSH. ( ssh_username@server_ip_address )
·       If you are running a system with Ubuntu, open the terminal emulator from the main menu.
·       Once the connection is successfully established, refresh the APT cache. To do this, run the command ( sudo apt update )
·       The Command above will ensure the repository is synchronized, and the system can download everything stored in it securely.
·       Install Node.js by running the following command ( sudo apt install nodejs ), The installation process will begin as soon as the password is inserted.
·       You can also install NPM Ubuntu which is the node. JS Package Manager. ( sudo apt install npm )
·       To check the pre-installed version, run the following command ( nodejs -v )

This method is the easiest way to install Node. js on a Linux or VPS-based Linux device.
To remove Node. js, run this command. ( sudo apt remove nodejs )

Install a specific version of Node. JS using NVM
               Here we will discuss another way to install Ubuntu 18.04 Node js. By using NVM (Node Version Manager),
 you can choose specific versions to install. It's just that, it would be better if you used the LTS version or the latest version.
Download the NVM by using wget. If there is no wget, run the following command.
sudo apt install wget
Then, run the following command:
wget -qO- | bash
The next step is to give NVM access so that it can be used through the Bash profile user. Run the following command:
source ~/.profile
Now you can already user NVM to display all the version of Node.js that can be installed
nvm ls-remote
Select the version of Node.js you want. For stability and support services, we recommend the 10.15.1 version. To use that version, run the command:

nvm install 10.15.1
You can see if the process was successful by looking at the
version of Node. js. To view it, Run command:
node -v
As you see, all the processes are running smoothly and there are no problems. Node. JS is installed and ready to use.
If you want to uninstall Node. js then reinstall it with this method, deactivate Node. js first.
nvm deactivate
Then, uninstall Node.js.
nvm uninstall v10.15.1