Procedure for Accessing the command line and PowerShell
To access the command prompt Windows, click on the search menu and type cmd on it. Right-click on cmd to get the option ‘Run as administrator’. Access to PowerShell can be done in the same manner. All you need to do is search for it by typing ‘PowerShell’ in the search bar. You have to set the option ‘Run as administrator’.
Procedure for Installing Node.js on Windows
A step-by-step guide to install Node.js on Windows is given here:
Step 1: Downloading the installer of Node.js on Windows along with the NPM package
The first step to download the installer is visiting the web browser and typing the link https://nodejs.org/en/download/. Once you land on the link, look for the ‘Windows Installer’ option. Make sure you are downloading the default version as it is always the recent one. Avoid downloading the outdated versions as they might not run on your system smoothly.
While installing the Node.js on Windows, you can also download the NPM as it comes in the same package. For older systems, you can also choose the 32-bit colour binary.
Step 2: Install both Node.js and NPM
After completing the installer download, you need to launch it properly for correct functioning. The best way to get access to the installer file is to browse through the location. Once you have done that, you can click on it.
Like all other software installations, you have to click on ‘Run’, ‘Next’, ‘Install’, and ‘Finish’ till the Node.js Wizard gets installed in your system in the right manner. If you are installing Node.js for the first time, try choosing the default option in case of any choice given to you. If you have some specific needs, you can go through the other options and download the right setup.
Step 3: Verification after Installation
To verify the installation of Node.js on your system, you can either open the PowerShell or command window and enter the commands node -v and npm -v. If the system shows versions for both along with other information, you can be sure regarding the installation.
An Alternative way to install Node.js on a Windows system
The alternative way of installing the Node.js environment on a Windows system is by supporting “Package Manager.”
The name for the NPM is Chocolatey on the Windows. You can download it at first and then download Node.js and finally install it.
Steps to Download
Step 1: Installation of Chocolatey
You have to visit the official website of Chocolatey and follow the instructions mentioned there to download it successfully. Here, it is given in brief for your convenience.
Access the command prompt and write the command that is present on the website of Chocolatey. You should be aware that it is a PowerShell command and it can activate the remote script easily. Consider it to be a technical approach to know the command and enter it rightly to download Node.js.
Step 2: Installing Node.js to the local machine
To install the Node.js, you have to install it on the local machine. Search for the right command and enter it without any mistake. However, you might come across some errors. In such cases, other commands can save you. If you face any Chocolatey error, make sure to start the installation process again from the first step.
Procedure for updating the Node.js and NPM
As a programmer, you must always know the right procedure to update the node.js and NPM. It can help you to work with both for a long time. Make sure to update the Node.js environment on a timely basis. It can be done in the following way:
Downloading a new version
When you update the Node.js and NPM, check if a new version is available on the site or not. If it is available, you need to download the whole package from the official website directly. Your system can now overwrite the older version with the recent one.
Process of Uninstalling Node.js and NPM
Step 1: Go to Settings of the Windows System
To get access to the Windows System’s Settings, you can click on Start and search for the Settings menu. On this menu, you have to search for Apps and click on it.
Step 2: Find Node.js
On the Apps list, you have to find the Node.js option and get to its Highlights.
Step 3: Uninstall
Once you click on the Highlights, a list with the Uninstall option will appear. All you have to do is click on the Uninstall and follow the wizard accordingly.