Installing Node.js® and NPM on Windows (2024)

What’s Node.js® and NPM?

Node.js® is a JavaScript-based environment which you can use to create web-servers and networked applications. You can also use it to perform helpful tasks on your computer such as concatenating and minifying JavaScript files and compiling Sass files into CSS.

NPM is a “package manager” that makes installing Node “packages” fast and easy. A package is just a code library that extends Node by adding useful features. For example, the “request” package simplifies the process of making HTTP requests so you can easily get web resources from other sites.

NPM is installed when you install Node.js®

Prerequisites

  • You should have some familiarity with an application that lets you issue command line instructions. For example, the Windows Command Prompt, PowerShell, Cygwin, or the Git shell (which you get when you install Github for Windows).

Installation Overview

Installing Node.js® and NPM is pretty straightforward using the installer package available from the Node.js web site.

Installation Steps

  1. Download the Windows installer from Nodejs.org. Installing Node.js® and NPM on Windows (1)
  2. Run the installer (the .msi file you downloaded in the previous step.)
  3. Follow the prompts in the installer (Accept the license agreement, click the NEXT button a bunch of times and accept the default installation settings).
    Installing Node.js® and NPM on Windows (2)
  4. Restart your computer. You won’t be able to run Node.js until you restart your computer.

Test it!

Make sure you have Node and NPM installed by running simple commands to see what version of each is installed:

  • Test Node. To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v. This should print the version number so you’ll see something like this v0.10.35.
  • Test NPM. To see if NPM is installed, type npm -v in Terminal. This should print the version number so you’ll see something like this 1.4.28
  • Create a test file and run it. A simple way to test that node.js works is to create a simple JavaScript file: name it hello.js, and just add the code console.log('Node is installed!');. To run the code simply open your command line program, navigate to the folder where you save the file and type node hello.js. This will start Node.js and run the code in the hello.js file. You should see the output Node is installed!.

Installing Node.js® and NPM on Windows (3)

How to Update Node and NPM

New versions of Node and NPM come out frequently. To install the updates, just download the installer from the Nodejs.org site and run it again. The new version of Node.js and NPM will replace the older versions.

How to Uninstall Node and NPM

You uninstall Node.js and NPM the same as you would most all Windows software:

  1. Open the Windows Control Panel
  2. Choose the Programs and Features option
  3. Click the “Uninstall a program”
  4. Select Node.js, and click the Uninstall link.

Installing Node.js® and NPM on Windows (4)

Installing Node.js® and NPM on Windows (2024)

FAQs

How to install Node.js and npm in Windows? ›

How to Install Node.js and NPM on Windows?
  1. Step 1: Download the Installer. Download the Windows Installer from NodeJs official website. ...
  2. Step 2: Install Node.js and NPM. After choosing the path, double-click to install .msi binary files to initiate the installation process. ...
  3. Step 3: Check Node.js and NPM Version.
Feb 14, 2024

Do we need to install Node and npm separately? ›

To install NPM(Node Package Manager), you will need to first install Node. js, which includes NPM as a default package.

What is the best way to install npm Node? ›

We strongly recommend using a Node version manager like nvm to install Node.js and npm. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally.

How do I know if Node.js is installed successfully? ›

To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v . This should print the version number so you'll see something like this v0. 10.35 .

Where is npm installed on Windows? ›

On most systems, this is /usr/local . On Windows, it's %AppData%\npm . On Unix systems, it's one level up, since node is typically installed at {prefix}/bin/node rather than {prefix}/node.exe .

How to use npm install? ›

To install a package, npm uses the following algorithm:
  1. load the existing node_modules tree from disk.
  2. clone the tree.
  3. fetch the package.json and assorted metadata and add it to the clone.
  4. walk the clone and add any missing dependencies.
  5. dependencies will be added as close to the top as is possible.
Sep 22, 2020

How do I know if Node and npm is installed? ›

Checking if Node & NPM are Installed
  1. Test Node. To see if Node is installed, open the Windows Command Prompt, Powershell or a similar command line tool, and type node -v . ...
  2. Test NPM. To see if NPM is installed, type npm -v in Terminal. ...
  3. Create a test file and run it. A simple way to test that node.
Jan 8, 2015

How to install npm and Node in windows 10? ›

Visit the official node. js site https://nodejs.org/en/download/ and click on Windows installer to download the necessary software in your system. The installer contains the NPM package. Based on the system you want to install, choose 32-bit installer or 64-installer and proceed.

How to install Node and npm? ›

Step 1: Download Node.js Installer

In a web browser, navigate to the Node.js Downloads page. Click the Windows Installer button to download the latest stable version with long-term support (LTS). The installer also includes the NPM package manager. The file is saved in the Downloads folder by default.

Should I install Node or npm? ›

nvm allows for easy installation and management of different Node. js versions without conflicting with each other. It is particularly helpful when you need to work with projects that depend on different Node. js versions, ensuring compatibility across different environments.

Where should I install npm install? ›

You should run it in your project root folder, or the folder above your node_modules folder as sometimes the structure can differentiate between projects. But in general: the root folder of your project, as long as it is one folder above your node_modules.

What to do before npm install? ›

The Basics: Getting started with npm
  1. Using npm init to initialize a project.
  2. Using npm init --yes to instantly initialize a project.
  3. Install modules with npm install.
  4. Install modules and save them to your package.json as a dependency.
  5. Install modules and save them to your package.json as a developer dependency.
Feb 10, 2022

Can you install Node.js on Windows? ›

The Node can be installed in multiple ways on a computer. The approach used by you depends on the existing development environment in the system. There are different package installers for different environments.

Does installing Node.js also install npm? ›

NPM is included with Node. js installation. After you install Node. js, verify NPM installation by writing the following command in terminal or command prompt.

How to install npm in terminal? ›

  1. Open Terminal.
  2. Run command to install nodejs : sudo apt install nodejs.
  3. Run command to verify installation by checking version: node -v or node –version.
  4. Run command to install npm: sudo apt install npm.
  5. Run command to verify installation of npm: npm -v or npm –version.
Oct 11, 2016

Top Articles
Latest Posts
Article information

Author: Annamae Dooley

Last Updated:

Views: 5828

Rating: 4.4 / 5 (45 voted)

Reviews: 84% of readers found this page helpful

Author information

Name: Annamae Dooley

Birthday: 2001-07-26

Address: 9687 Tambra Meadow, Bradleyhaven, TN 53219

Phone: +9316045904039

Job: Future Coordinator

Hobby: Archery, Couponing, Poi, Kite flying, Knitting, Rappelling, Baseball

Introduction: My name is Annamae Dooley, I am a witty, quaint, lovely, clever, rich, sparkling, powerful person who loves writing and wants to share my knowledge and understanding with you.