Node.js это кроссплатформенная среда исполнения, позволяющая запускать серверные (бэкенд) приложения JavaScript вне браузера. В этой статье мы рассмотрим, как установить фреймворк Node.js и его менеджер пакетов NPM в Windows.
Для установки Node.js и NPM можно скачать с официального сайта готовый установщик в виде MSI пакета (https://nodejs.org/en/download/prebuilt-installer). На сайте доступны MSI пакеты для x86 и x64 версий Windows. Если нет специальных требования, обычно рекомендуется устанавливать LTS версию Node.js (Long Term Support) .
Запустите установку из MSI пакета с настройками по умолчанию.
MSI пакет содержит не только сам фреймоворк Node.js, но и также менеджер пакетов NPM, который устанадливается по-умолчанию. Установщик позволяет автоматически добавить пути к директориям node.js и npm в переменные окружения Windows.
Встроенный в node.js менеджер Node Package Manager (NPM), используется для загрузки и установки сторонних модулей из внешних репозиториев.
Для компиляции некоторых модулей, установленных через npm, могут потребоваться среды разработки python и Visual Studio. Вы можете разрешить NPM автоматически устанавливать необходимые инструменты, либо установить их в дальнейшем вручную через Chocolatey (https://github.com/nodejs/node-gyp#on-windows).
После окончания установки, проверьте что Node.js и npm установлены. Выполните следующие команды, чтобы вывести версии инструментов:
node -v
npm -v
Также для установки Node.js можно использовать менеджер пакетов WinGet, который установлен по-умолчанию в Windows 10 и 11.
winget install OpenJS.NodeJS.LTS
Эта команда автоматически скачает и в тихом режиме установит последнюю LTS версию Node.js.
Перезапустите консоль cmd/powershell, чтобы обновить пути в переменных окружения. Проверьте, что node.js и NPM успешно установлены и пути к ним прописаны в переменной окружения PATH:
(Get-ChildItem env:Path).value -split ";"
C:\Program Files\nodejs\ C:\Users\%username%\AppData\Roaming\npm
Также можно установить Node.js в Windows с помощью пакетного менеджера Chocolatey:
Choco install -y nodejs.install
Проверить работу Node.js можно с помощью простого JavaScript скрипта. Создайте текстовый файл hello.js с кодом:
console.log("Hello, world!")
Запустите скрипт с помощью node.js:
node hello.js
Для серверных развертываний Node.js, рекомендуется использовать менеджер версий NVM (Node Version Manager) для установки Node.js и npm.
NVM позволяет установить на компьютере несколько версию Node.js и переключаться между ними. Кроме того, в отличии от MSI установщика Node.js, NPM не использует профиль текущего пользователя для хранения данных. Это позволит исключить проблемы с путями и разрешениями при запуске сервисов.
Для установки NVM в Windows воспользуетесь пакетом NVM for Windows ( https://github.com/coreybutler/nvm-windows). Скачайте файл nvm-setup.exe и запустите установку.
Для установки определенной версии Node.js через NVM, используется команда:
nvm install 21
Вывести список установленных версий Node:
nvm list
Чтобы переключиться между версиями:
nvm use 20.11.0
При переключении версий скрипт nvm подменяет путь до Node.js в переменной PATH.
Last Updated :
23 Apr, 2025
NodeJS and NPM (Node Package Manager) are essential tools for modern web development. NodeJS is the runtime environment for JavaScript that allows you to run JavaScript outside the browser, while NPM is the package manager that helps manage libraries and code packages in your projects.
To run a Node.js project on your system, you first need to install Node.js and NPM. Once installed, you can use the Node.js runtime to execute JavaScript code and NPM to manage project dependencies and packages.
Note: We do not need to download NodeJS and NPM separately. When we install NodeJS, NPM (Node Package Manager) is installed automatically along with it.
How to download and install NodeJS and NPM
Follow the below given steps below to download and install NodeJS and npm on your system:
Step 1: Download the package from its Official Website
Go to the official NodeJS website.
You will see two main download options:
- LTS (Long-Term Support): This version is recommended for most users, especially for production environments, as it is stable and receives long-term updates.
- Current: This version includes the latest features but may not be as stable as the LTS version.
- Click on the version you wish to download. The website will automatically detect your operating system and recommend the appropriate version (Windows, macOS, or Linux).
Installing NodeJS is the first step towards building scalable web applications.
Step 2: Install NodeJS and NPM
Now you need to install the NodeJS installer on your system. You need to follow the following steps for NodeJS to be installed.
- Double-click on the .msi installer. The NodeJS Setup wizard will open.
- Welcome To NodeJS Setup Wizard.
- Now, select “Next” to proceed.
Step 3: Finish Setting up
Go through the terms and license carefully before finishing up the setup.
- After clicking “Next”, the End-User License Agreement (EULA) will open.
- Check “I accept the terms in the License Agreement.”
- Select “Next.”
Step 4: Set Download Path
At last, it will ask for a «Destination Folder» where all the files and their utility will be saved, provide the path where you want to install NodeJS and then click on NEXT.
- Or, if you wish to perform «Custom Setup», click on Change and choose your desired path.
- Then, select “Next”
Step 5: Get the System Ready to Complete the Setup
The installer may prompt you to “install tools for native modules”.
- Select “Install”
- Do not close or cancel the installer until the installation is complete.
- Complete the NodeJS Setup Wizard.
- Click “Finish.”
Step 6: Verify the Installation
Once the installation is complete, you can verify that both NodeJS and NPM are installed correctly by running the following commands in your terminal or command prompt:
- Verify NodeJS Installation:
node -v
This command will display the installed version of NodeJS.
- Verify NPM Installation:
npm -v
This command will display the installed version of NPM.
If both commands return the version numbers, it means that NodeJS and NPM are successfully installed on your system.
Start creating your NodeJS application.
Conclusion
That’s it! You’ve successfully installed NodeJS and NPM on your system, and you’re ready to start building and managing NodeJS projects. With NPM, you can easily install third-party libraries, manage dependencies, and work on large-scale JavaScript projects.
In this article, you’ll learn how to work with JavaScript in the backend using Node on Windows.
When you start working with JavaScript and discover that you can not only work with it in the frontend but also in the backend, a new world of possibilities seems to open up before you.
To begin with, you realize that you don’t need to learn another language to have the backend of your applications up and running. Second, Node.js is simple to install and works in all development platforms we are used to: Mac, Linux, and Windows.
In this article, I’ll show you how to install Node on Windows with a step-by-step guide so you’re ready to use it.
You will also be happy to know that package management is made even easier, as npm (the Node Package Manager) comes with the installation of Node.
With it, you will be able to have access to an almost unending number of community-made dependencies. You can simply install these in your app so you don’t have to reinvent the wheel time and again.
So let’s install Node on Windows and start playing with it a bit.
The first thing to do is to access Node’s official site.
Node site front page
The website is intelligent enough to detect the system you are using, so if you are on Windows, you will most likely get a page like the one above. Right in the middle of it, two buttons show you the most common possibilities of download – also the latest ones.
If you are curious about all the most recent features Node has to offer, go with the button on the right. For most people, however, the site itself recommends using the Long-Term Support version, which leads you to the button on the left.
At the moment of writing this article, the LTS version is version 16.14.0.
When you click on any of them, an .msi file gets downloaded to your computer. The next step is to click on it and the installation will begin. The wizard opens and the following window appears:
Node installation wizard’s initial page
Click Next. On the following window, you’ll read (you do read it, right?) Node’s EULA, accept its terms, and click Next again. The next window is the one where you select the destination folder for Node.
Windows normally recommends that the programs be installed in the Program Files folder, in a folder of their own (in our case, we are installing Node.js, so the nodejs folder is our go-to place).
For the sake of simplicity, let’s follow the wizard’s suggestions and use C:\Program Files\nodejs\
as the destination folder.
The following window is the one where you can customize your installation. Unless you have disk space problems or have a clear idea as to what you are doing, I recommend keeping the options as they are and just pressing Next again.
One thing I would like to point out on this window is the third option you see. That’s the option that allows you to have npm installed along with Node on your computer. This way, if you still intend to change the setup in this page somehow, keep that option as is and npm will be installed for you at the end of the process.
The next window deals with the automatic installation of “Tools for Native Modules”. Again, unless you are sure you need them, I recommend keeping this checkbox unmarked and just pressing Next once more.
We’ve reached the final pre-install window. As it says, from here, you just have to click Install to begin the installation, so let’s do it.
Notice the shield beside the word Install? That means Windows will ask you to confirm if you really want to go through the installation process as soon as you click that button. Assuming this is the reason why you are reading this article, just click Yes and let the installer do its thing.
We finally got to the window we were hoping for, telling us that Node has successfully been installed on our Windows computer. Click Finish and let’s check if everything is ok.
How to Check Your Node Installation
In order to check if Node (and npm) were properly installed on your computer, you can choose to open either Windows Powershell or the Command Prompt.
We’ll go with the first. Click on the search bar beside the Start Menu button and type powershell
. Click Enter and Windows Powershell will open up in a window for you.
In any folder (like C:\Users
, for instance), you can type node -v
to check for the version of Node you are using. As I mentioned above, the latest version as I write this article is version 16.14.0 and that’s exactly what we see on Powershell above.
As a side note, you may be asking yourself why we can check this in any folder. One of the options in the custom setup (that we left as is) was to add Node to PATH. By doing so, we are able to access it from anywhere while navigating through the folders.
It is also possible to check for the npm version. To do so, type npm -v
and press Enter. In our case, latest version is version 8.3.1, so we can pretty much say we are up to date.
How to Use npm
Ok, but you did not go all this way reading just to finish here after installing Node and npm, right? You want to see both in action. Let’s do it, then.
To learn how to start a project with Node and install packages with npm, we’ll use Visual Studio Code.
We’ll create a folder named Node_Test, where we’ll put both Node and npm to work a little.
Let’s start simple. Inside the Node_Test folder, right click inside the folder and click Open with Visual Studio Code. This will make VS Code open in this empty folder automatically.
Inside VS Code, if you haven’t yet, open a new terminal by pressing Ctrl+Shift+'
(single quote).
Click on the terminal and, on the command line, type npm init -y
. This will start a Node project automatically for us without us needing to worry about the initial configuration (the -y
flag will do that on its own). This creates a package.json file within the Node_Test folder.
Next, let’s install Express as a dependency. You can find it and a list of other possible dependencies of npm on https://www.npmjs.com/.
Another side note: every time you open npm’s web site, on the top left, you will see what appears to be a meaningless combination of three words. If you look at the initials, though, you will see that it is a brand-new sequence with the acronym npm.
Right, now let’s install Express with this Nifty Purring Manticore. Back on VS Code and the terminal, type npm i express
and press Enter. Express will be installed. You can do the same with any other dependency you can think about.
To make sure that Express is installed, open package.json. Scroll up to the list of dependencies and you will see Express there.
Wrapping Up
That’s pretty much it. In this article, you saw how to install Node and npm on Windows.
I hope this has been useful to you. For more tutorials like this, check out freecodecamp.org/news and browse for the topic you would like to learn about.
Happy coding! 😊
Learn to code for free. freeCodeCamp’s open source curriculum has helped more than 40,000 people get jobs as developers. Get started
Facing the task of installing npm on Windows more frequently than anticipated, we at IOFLOOD understand the confusion it can bring. Due to this, we’ve compiled a guide to simplify the process. By following our concise instructions, you’ll be able to navigate through the installation steps and verify npm’s presence on your system using basic commands.
This guide will walk you through installing npm on Windows, ensuring you’re set up for success. Whether you’re a beginner looking to get your feet wet in web development, or a seasoned programmer aiming to streamline your workflow, understanding how to efficiently install npm on Windows is crucial.
Let’s dive in and unlock the full potential of Node.js development on your Windows system.
TL;DR: How Do I Install npm on Windows?
To install npm on Windows, download the Node.js installer from the official website, run it, and follow the installation wizard. npm is automatically installed along with Node.js, so there’s no need for separate installation. After installation, open Command Prompt or PowerShell and use
node -v
andnpm -v
commands to verify installation.
Here’s a quick example:
C:\Users\YourUsername> node -v
v14.17.0
C:\Users\YourUsername> npm -v
6.14.13
In the provided code example, you’re seeing the output of two commands executed in Command Prompt or PowerShell – node -v
, which checks the installed version of Node.js, and npm -v
, which checks the version of npm (Node Package Manager) installed on your system.
This TL;DR section provides a quick answer to getting npm up and running on Windows. However, for more detailed instructions, including advanced setups and troubleshooting, keep reading.
Table of Contents
- Installing Node.js & npm on Windows
- Installation w/ Version Managers
- Chocolatey npm Installation
- Troubleshooting Windows Installation
- Understanding npm and Node.js
- Environment Setup and Usage of npm
- Summary: Installing npm on Windows
Installing Node.js & npm on Windows
Embarking on the journey of Node.js development on Windows requires the installation of npm, the Node Package Manager, which is bundled with Node.js. This guide aims to simplify the process, leading you through each step with clarity.
Step 1: Download the Node.js Installer
Begin by navigating to the official Node.js website from your Windows browser. Here, you’ll be greeted with two versions of Node.js for download: LTS (Long Term Support) and Current. For most users, especially beginners, selecting the LTS version is recommended as it’s more stable.
Step 2: Run the Installer
Once the download is complete, locate the installer file (typically named node-vxx.xx.x-x64.msi
for 64-bit systems) and double-click to initiate the installation process. The setup wizard will guide you through several steps:
- Accept the license agreement.
- Choose the installation location.
- Select components to install (ensure npm is checked).
- Configure tools (optional).
- Install.
Step 3: Verify Installation
After installation, it’s crucial to verify that Node.js and npm were successfully installed. Open a new command prompt or PowerShell window and enter the following commands:
node -v
npm -v
# Output:
# v14.17.0
# 6.14.13
The output will display the installed versions of Node.js and npm, respectively. Seeing these version numbers confirms a successful installation.
Understanding the Output
The displayed version numbers are your first glimpse into the Node.js and npm ecosystem. The node -v
command shows the version of Node.js installed on your system, while npm -v
reveals the version of npm. This step is crucial for ensuring that the installation process was completed successfully and that you’re ready to begin your development journey.
By following these steps, you’ve successfully installed Node.js and npm on your Windows machine, opening the door to a vast world of JavaScript development. Whether you’re planning to build web applications, create server-side scripts, or manage packages, you’re now equipped with the foundational tools needed to embark on your projects.
Installation w/ Version Managers
While the basic installation of Node.js and npm sets you up for immediate development, intermediate developers might seek more flexibility. This is where version managers like nvm-windows
come into play. Using a version manager allows you to install multiple versions of Node.js (and consequently npm), enabling you to switch between them as needed. This capability is invaluable for testing applications across different Node.js versions or maintaining projects that require specific versions.
Why Use a Version Manager?
Version managers offer several benefits:
- Flexibility: Easily switch between Node.js versions.
- Compatibility: Test your projects across different versions.
- Convenience: Simplify the installation and management of Node.js versions.
Setting Up nvm-windows
To install nvm-windows
, a popular Node Version Manager for Windows, follow these steps:
- Download the latest release of
nvm-windows
from its GitHub releases page. - Run the installer and follow the on-screen instructions.
After installation, you can verify that nvm
is correctly installed by opening a command prompt and typing:
nvm version
# Output:
# 1.1.7
This command displays the installed version of nvm-windows
, indicating the tool is ready for use. With nvm
installed, you can now install Node.js versions. For example, to install Node.js version 14.17.0, use the following command:
nvm install 14.17.0
nvm use 14.17.0
# Output:
# Now using node v14.17.0 (64-bit)
The nvm install
command downloads and installs the specified version of Node.js. The nvm use
command then switches to using the specified version. The output confirms that Node.js version 14.17.0 is now active.
Switching Between Versions
Switching between installed Node.js versions is as simple as using the nvm use
command with the desired version number. This feature allows developers to quickly adapt to the requirements of different projects or testing environments.
By incorporating nvm-windows
into your development setup, you gain the ability to manage multiple Node.js versions with ease, enhancing your development workflow and ensuring compatibility across various environments. This advanced setup step is a game-changer for developers looking to maximize their productivity and project compatibility.
Chocolatey npm Installation
For experts aiming to streamline their Node.js and npm installation on Windows, package managers like Chocolatey offer a robust alternative. Chocolatey is a Windows package manager that simplifies the process of managing software installations, allowing you to install, update, and manage your software tools and libraries with command-line instructions.
Why Choose Chocolatey?
- Efficiency: Automate the installation and updates of software.
- Consistency: Maintain consistent environments across multiple machines.
- Control: Manage versions and dependencies with ease.
Installing Node.js and npm with Chocolatey
To leverage Chocolatey for installing Node.js and npm, first ensure Chocolatey is installed on your Windows system. If not, visit the official Chocolatey installation guide for instructions. Once Chocolatey is set up, you can install Node.js (which includes npm) using the following command:
choco install nodejs
# Output:
# Chocolatey v0.10.15
# Installing the following packages:
# nodejs
# By installing you accept licenses for the packages.
# ...
# Node.js v14.17.0 installed
This command instructs Chocolatey to download and install the latest stable version of Node.js and npm. The output details the installation process, including the version of Node.js installed. This method is particularly useful for developers and system administrators looking to automate the setup of development environments or maintain multiple machines.
Comparison with Direct Installation
While direct installation via the official Node.js installer is straightforward for individual setups, Chocolatey shines in scenarios requiring automation or consistency across several Windows machines. It offers a higher level of control over software versions and dependencies, making it an ideal tool for expert users and system administrators.
In conclusion, while beginners might prefer the simplicity of the official installer, experts managing multiple environments or requiring advanced control over their setups might find the capabilities of Chocolatey to be invaluable. This approach not only simplifies the installation process but also provides powerful tools for managing software installations across diverse environments.
Troubleshooting Windows Installation
Even with a smooth installation process, you might encounter issues when installing npm on Windows. This section addresses common problems such as PATH configuration issues, version conflicts, and permissions errors, providing solutions and best practices to navigate these hurdles.
PATH Configuration Issues
One common issue after installing Node.js and npm is finding that commands aren’t recognized in the command prompt. This usually indicates a PATH configuration problem, where Windows doesn’t know where to look for the installed Node.js and npm executables.
To verify your PATH, open a command prompt and type:
echo %PATH%
Ensure the path to your Node.js installation is listed. If not, you’ll need to add it manually via the System Properties -> Environment Variables -> System Variables -> Path.
Handling Version Conflicts
Version conflicts can arise when projects require different versions of Node.js or npm. Using a version manager like nvm-windows
can help manage these conflicts by allowing you to switch between versions easily. For instance, to switch to Node.js version 12.18.3, you would use:
nvm use 12.18.3
# Output:
# Now using node v12.18.3 (64-bit)
This command switches the active Node.js version, mitigating version conflict issues.
Permissions Errors During Installation
Permissions errors can occur, particularly when attempting to install global npm packages without administrator privileges. To resolve this, run the command prompt as an administrator or use the --global
flag with caution, ensuring you understand the implications.
For example, to install a package globally without encountering permissions issues, you might use:
npm install -g package-name
Running the command prompt as an administrator should circumvent most permission-related errors, allowing for a smoother installation process.
Best Practices to Avoid Common Pitfalls
- Regularly update npm and Node.js to their latest stable versions to minimize compatibility issues.
- Use version managers like
nvm-windows
to handle multiple Node.js versions more efficiently. - Always verify your PATH configuration after installation to ensure your system recognizes the Node.js and npm commands.
By addressing these common issues and adhering to best practices, you can ensure a more reliable and efficient npm installation experience on Windows, paving the way for successful development projects.
Understanding npm and Node.js
Before diving into the technicalities of installing npm on Windows, it’s essential to grasp what npm is and why it’s a cornerstone in modern JavaScript development. npm, which stands for Node Package Manager, is the largest software registry in the world. It allows developers to share and borrow packages, manage project dependencies, and publish their solutions for others to use.
npm: The Heart of JavaScript Ecosystem
npm works closely with Node.js, a runtime environment that executes JavaScript code outside of a web browser. This collaboration has revolutionized how developers build and deploy applications, making JavaScript a powerful tool not just for client-side scripting but for server-side applications as well.
To understand the synergy between npm and Node.js, consider this example:
npm init -y
# Output:
# Wrote to /your-project/package.json:
# {
# "name": "your-project",
# "version": "1.0.0",
# ...
# }
The npm init -y
command creates a package.json
file in your project directory. This file is crucial as it manages your project’s dependencies, scripts, and version information. The -y
flag automatically fills the file with default values, speeding up the setup process for new projects.
The Role of npm in Development
The creation of the package.json
file exemplifies npm’s role in project management. By handling dependencies, npm ensures that you’re working with the right versions of libraries and tools, reducing conflicts and compatibility issues. Moreover, npm facilitates collaboration among developers by allowing them to share their packages globally, contributing to a vast and accessible ecosystem.
In summary, npm is not just a tool for installing packages. It’s an integral part of the JavaScript development landscape, enabling efficient project management, seamless collaboration, and a unified ecosystem for developers. Understanding its fundamentals is crucial for anyone looking to excel in JavaScript development, especially when working within the Node.js environment.
Environment Setup and Usage of npm
Once you’ve mastered the basics of npm on Windows, the next step is to explore advanced npm topics such as package management, utilizing npm scripts, and optimizing your development environment. These areas offer powerful capabilities that can significantly enhance your workflow and project management efficiency.
Mastering Package Management with npm
Effective package management is crucial for maintaining project dependencies and ensuring your applications run smoothly. npm makes this task manageable by providing commands to add, update, and remove packages. For instance, adding a package as a development dependency is done with the following command:
npm install package-name --save-dev
# Output:
# + package-name@version
# added 1 package in 0.556s
This command installs the specified package and adds it to the devDependencies
section of your package.json
file. Development dependencies are packages that are only needed for local development and testing, not in your production environment. This distinction helps keep your production environment lean and efficient.
Leveraging npm Scripts for Automation
npm scripts are a powerful feature that can automate repetitive tasks such as testing, building, and deploying your applications. You define these scripts in your package.json
file, making them easily accessible and executable with a simple npm command. For example, running a test script might look like this:
npm run test
# Output:
# > [email protected] test /your-project
# > echo "Error: no test specified" && exit 1
Defining and using npm scripts streamlines your workflow by encapsulating complex tasks into single commands, improving productivity and consistency across projects.
Setting Up a Productive Development Environment
A well-configured development environment can significantly boost your efficiency and reduce setup times for new projects. Tools like ESLint for code quality, and webpack for module bundling, can be integrated into your npm workflow, enhancing your development process.
Further Resources for npm Mastery
To deepen your understanding of npm and its ecosystem, consider exploring the following resources:
- npm Documentation: An invaluable resource for learning about npm’s features and commands.
-
Node.js Guides: These guides provide insights into using Node.js and npm in various scenarios.
-
The npm Blog: Stay updated with the latest news, updates, and tips from the npm community by following the npm blog.
By leveraging these resources and diving into advanced npm topics, you can enhance your Node.js and JavaScript development skills, making you a more proficient and efficient developer.
Summary: Installing npm on Windows
In this comprehensive guide, we’ve navigated the essential steps and advanced strategies for installing npm on Windows, laying the foundation for your Node.js and JavaScript development journey. From the straightforward approach of downloading Node.js (which includes npm) from the official website to leveraging version managers and package managers for more complex setups, we’ve covered a spectrum of methods to suit developers at all levels.
We began with the basics, showing how to download and install Node.js and npm using the Windows Installer. This method is ideal for beginners or those looking for a quick setup. We then explored advanced techniques, such as using version managers like nvm-windows
to manage multiple Node.js versions, offering flexibility and control over your development environment.
For experts, we delved into alternative approaches like using Chocolatey, a package manager that streamlines the installation process and provides robust management tools for software dependencies. This approach is particularly useful for those managing multiple machines or requiring greater control over their development setup.
Approach | Pros | Cons |
---|---|---|
Windows Installer | Simple and quick | Limited version control |
Version Managers | Flexible version management | Slightly higher learning curve |
Chocolatey | Automated, robust management | Requires familiarity with package managers |
Whether you’re just starting out with npm or looking to refine your setup, this guide has equipped you with the knowledge to install npm on Windows effectively. By understanding the various installation methods, troubleshooting common issues, and exploring advanced techniques, you’re well-prepared to embark on your development projects with confidence.
The ability to manage packages efficiently is a cornerstone of modern web development. With npm installed on your Windows machine, you’re ready to tap into the vast ecosystem of JavaScript tools and libraries, enhancing your projects and workflow. Happy coding!
Download Windows Speedup Tool to fix errors and make PC run faster
Node Package Manager (NPM) is installed on your Windows computer once you install Node.js. It is a package manager for modules of Node.js, and it’s ready to run on your Windows PC. In this article, we will show you how to install NPM on Windows 11/10, step by step.
NPM is a registry and library for JavaScript apps with a command line for interacting with the repository to help in installing and managing package versions and other dependencies. The repository is used for publishing open-source projects in Node.js.
Why should I install NPM?
It is possible to manage your project packages yourself. However, when the project grows, you will only be able to handle some of the projects. At this point, you need NPM to handle your dependencies and manage your packages. With NPM, you define all dependencies and packages in a package.json file, and when you want to get started, you install npm.
The NPM software is ready to run on your PC when you install Node.js. To install Node.js and NPM on Windows 11 or Windows 10 computers, use either of the two methods below:
- Use Node.js installer
- Use Chocolatey
Let us look at these methods in detail.
1] Use Node.js installer
This method involves installing libraries for Node.js on the client operating system. So, to download and install Node.js on Windows 11 or Windows 10, follow the steps below:
- Open your browser and go to the official Node.js download page.
- Here, locate the correct binary. In this case, click LTS Recommended For Most Users, and download a 64-bit Windows Installer (.msi) file.
- Go to the browser downloads and click the file to start the installation process.
- Click Run when the Open File – Security Warning wizard appears.
- Follow the other on-screen steps to complete the installation.
2] Use Chocolatey
To install NPM using Chocolatey on Windows 11 or Windows 10, use the following simple steps:
Search for Windows PowerShell in the search box and select Run as administrator.
Run the following commands, each at a time:
@powershell -NoProfile -ExecutionPolicy Bypass -Command “iex ((new-object wet.webclient).DownloadString(‘https://chocolatey.org/install.ps1’))” && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
cinst nodejs install
Note: You can run these scripts without PowerShell profiles.
That’s it for now. Hopefully, one of the methods works for you.
Read: Setup Node.js development environment on Windows computer
How do you check if NPM is installed?
To check if NPM is installed on your system, run the command C:\Users\Admin> node -v on either the Command Prompt or Windows PowerShell. If it is installed, you will get a notification about Node.js on your PC. If you get a message that it’s not installed, you can add the path manually.
Next: What does Javascript:void(0) mean how to fix Javascript:void(0) error?
What does Node.js do?
Node.js can perform several actions, such as generating page content and collecting data. It can also add, modify, and delete data from databases. Finally, you can use Node.js to open, delete, create, read, close, and write files on the system server.
Robert holds a B.Tech. He has a knack for solving problems in people’s lives. With his background in technology, he is able to write complex topics in simple, understandable terms. He enjoys writing all matters Windows.