Introduction to Node.js and NPM
- Node.js is an open source server environment
- It’s absolutely free to use
- It runs on various platforms (Windows, Linux, Unix, Mac OS X, etc.)
What is a Package?
A package in Node.js contains all the files you need for a module.
This explanation will help you install and update Node.js and NPM on a Windows system and other useful Node.js commands.
- A user account with administrator privileges (or the ability to download and install software) / Download in browser.
- Access to the Windows command line (search > cmd > right-click > run as administrator) OR Windows PowerShell (Search > Powershell > right-click > run as administrator)
Let’s do it together, and practice on how to install these using command line and browser:
Step 1: Download Node.js Installer
Open a web browser, go diretly to this url: https://nodejs.org/en/download/ .
Click the Windows Installer button to download the latest default version. Check the latest recommended version to download. The Node.js installer itself includes the NPM package manager. So, you dont need to worry about this too much. We can check the version, once installed in our device.
Step 2: Direct: Install Node.js and NPM from Browser
1. Once the downloading is finished, launch it. Open the downloads link in your browser and click the file. Or, search for the directory where you have saved the file and double-click it to install and launch.
2. The application will ask if you want to run the program software – click Run.
3. Next the Node.js Setup Wizard screen appear – click Next.
4. On the next screen, check list and agree. Click Next when you agree to the terms and install the software.
5. The software will prompt you for saving the application to the location. Leave the default location – then click Next.
6. The wizard screen will allow you to select components to include or remove from the installation. Again, you don’t need to do anything, accept the defaults selection and click Next.
7. Final step, click the Install button to run the installer. When it finishes, click Finish.
Step 3: To verify Installation check the latest updated version
#1. Open a Command Line Interface prompt (or PowerShell), and enter the following:
#2. The system should display the Node.js version installed on your system. You can do the same for NPM:
How to Update Node.js and NPM on Windows: follow same procedure as above –
To upgrade the Node.js version, download the installer and run it again. The setup wizard will overwrite the old version, and replace it with the new version.
How to Uninstall Node.js and NPM on Windows
You can uninstall Node.js from the Windows.
To do so – go to Control panel directly or follow the given process below:
- Click the Start button -> Settings (gear icon) -> Apps.
- Scroll down to find Node.js and do the right-side click.
- Select Uninstall. This launches a wizard to uninstall the software.