What is NodeJS?
Node.js is an open-source, cross-platform, server-side JavaScript runtime environment built on Chrome’s V8 JavaScript engine originally authored by Ryan Dahl and released in 2009.
Does Node.js work on Windows?
Yes. Windows supports two different environments for developing apps with Node.js:
- Install a Node.js development environment on Windows
- Install a Node.js development environment on Windows Subsystem for Linux
For help determining which environment to use, check out Should I install on Windows or Windows Subsystem for Linux?
What can you do with NodeJS?
Node.js is primarily used for building fast and scalable web applications. It uses an event-driven, non-blocking I/O model, making it lightweight and efficient. It’s a great framework for data-intensive real-time applications that run across distributed devices. Here are a few examples of what you might create with Node.js.
- Single-page apps (SPAs): These are web apps that work inside a browser and don’t need to reload a page every time you use it to get new data. Some example SPAs include social networking apps, email or map apps, online text or drawing tools, etc.
- Real-time apps (RTAs): These are web apps that enable users to receive information as soon as it’s published by an author, rather than requiring that the user (or software) check a source periodically for updates. Some example RTAs include instant messaging apps or chat rooms, online multiplayer games that can be played in the browser, online collaboration docs, community storage, video conference apps, etc.
- Data streaming apps: These are apps (or services) that send data/content as it arrives (or is created) while keeping the connection open to continue downloading further data, content, or components as needed. Some examples include video- and audio-streaming apps.
- REST APIs: These are interfaces that provide data for someone else’s web app to interact with. For example, a Calendar API service could provide dates and times for a concert venue that could be used by someone else’s local events website.
- Server-side rendered apps (SSRs): These web apps can run on both the client (in your browser / the front-end) and the server (the back-end) allowing pages that are dynamic to display (generate HTML for) whatever content is known and quickly grab content that is not known as it’s available. These are often referred to as “isomorphic” or “universal” applications. SSRs utilize SPA methods in that they don’t need to reload every time you use it. SSRs, however, offer a few benefits that may or may not be important to you, like making content on your site appear in Google search results and providing a preview image when links to your app are shared on social media like Twitter or Facebook. The potential drawback being that they require a Node.js server constantly running. In terms of examples, a social networking app that supports events that users will want to appear in search results and social media may benefit from SSR, while an email app may be fine as an SPA. You can also run server-rendered no-SPA apps, which my be something like a WordPress blog. As you can see, things can get complicated, you just need to decide what’s important.
- Command line tools: These allow you to automate repetitive tasks and then distribute your tool across the vast Node.js ecosystem. An example of a command line tool is cURL, which stand for client URL and is used to download content from an internet URL. cURL is often used to install things like Node.js or, in our case, a Node.js version manager.
- Hardware programming: While not quite as popular as web apps, Node.js is growing in popularity for IoT uses, such as collecting data from sensors, beacons, transmitters, motors, or anything that generates large amounts of data. Node.js can enable data collection, analyzing that data, communicating back and forth between a device and server, and taking action based on the analysis. NPM contains more than 80 packages for Arduino controllers, raspberry pi, Intel IoT Edison, various sensors, and Bluetooth devices.
Next steps
- Should I install on Windows or Windows Subsystem for Linux (WSL)?
- Install NodeJS on Windows
- Install NodeJS on WSL
- Build JavaScript applications with Node.js learning path
Feedback
Submit and view feedback for
How to Install Node.js and NPM on Windows
Node.js is a run-time environment which includes everything you need to execute a program written in JavaScript. It’s used for running scripts on the server to render content before it is delivered to a web browser.
NPM stands for Node Package Manager, which is an application and repository for developing and sharing JavaScript code.
This guide 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)
- Access to the Windows command line (search > cmd > right-click > run as administrator) OR Windows PowerShell (Search > Powershell > right-click > run as administrator)
Note: If you want to install the run-time environment on a different operating systems, check out our guides on installing Node.js and NPM on CentOS 7, How to Install Node.js on Debian, or How to Install Node.js and NPM on Mac.
How to Install Node.js and NPM on Windows
Step 1: Download Node.js Installer
In a web browser, navigate to https://nodejs.org/en/download/. Click the Windows Installer button to download the latest default version. At the time this article was written, version 10.16.0-x64 was the latest version. The Node.js installer includes the NPM package manager.

Note: There are other versions available. If you have an older system, you may need the 32-bit version. You can also use the top link to switch from the stable LTS version to the current version. If you are new to Node.js or don’t need a specific version, choose LTS.
Step 2: Install Node.js and NPM from Browser
1. Once the installer finishes downloading, launch it. Open the downloads link in your browser and click the file. Or, browse to the location where you have saved the file and double-click it to launch.
2. The system will ask if you want to run the software – click Run.
3. You will be welcomed to the Node.js Setup Wizard – click Next.
4. On the next screen, review the license agreement. Click Next if you agree to the terms and install the software.
5. The installer will prompt you for the installation location. Leave the default location, unless you have a specific need to install it somewhere else – then click Next.
6. The wizard will let you select components to include or remove from the installation. Again, unless you have a specific need, accept the defaults by clicking Next.
7. Finally, click the Install button to run the installer. When it finishes, click Finish.
Step 3: Verify Installation
Open a command prompt (or PowerShell), and enter the following:
node -v
The system should display the Node.js version installed on your system. You can do the same for NPM:
npm -v

If npm is not recognized or properly installed, command prompt will display the following error message: npm: command not found.
How to Update Node.js and NPM on Windows
The easiest way to update Node.js and NPM is to download the latest version of the software. On the Node.js download page, right below the Windows Installer link, it will display the latest version. You can compare this to the version you have installed.
To upgrade, download the installer and run it. 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 Control Panel in Windows.
- Click the Start button >Settings (gear icon) >Apps.
- Scroll down to find Node.js and click to highlight.
- Select Uninstall. This launches a wizard to uninstall the software.
Basic Node.js Usage
Node.js is a framework, which means that it doesn’t work as a normal application. Instead, it interprets commands that you write. To test your new Node.js installation, create a Hello World script.
1. Start by launching a text editor of your choice.
2. Next, copy and paste the following into the text editor you’ve just opened:
var http = require('http'); http.createServer(function (req, res) < res.writeHead(200, ); res.end('Hello World!'); >).listen(8080);
3. Save the file, then exit. Open the PowerShell, and enter the following:
node \users\\myprogram.js
It will look like nothing has happened. In reality, your script is running in the background. You may see a Windows Defender notice about allowing traffic – for now, click Allow.
4. Next, open a web browser, and enter the following into the address bar:
http://localhost:8080
In the very upper-left corner, you should see the text Hello World!
Right now, your computer is acting like a server. Any other computer that tries to access your system on port 8080 will see the Hello World notice.
To turn off the program, switch back to PowerShell and press Ctrl+C. The system will switch back to a command prompt. You can close this window whenever you are ready.
You should now be able to install both the Node.js framework, and the NPM package manager. You’ve also written your first node.js JavaScript program!
The NPM framework gives access to many different JavaScript solutions, which can be found at npmjs.com.
Как обновить npm и пакеты npm ?
Как всегда, есть нюанс. Update обновляет пакеты в соответствии с записями из package.json , поэтому надо учитавать знаки больше/меньше, тильды, крышки и равно. Если пакет задан как = 1.0.67, то npm update его не обновит.
Если нужно поставить версии пакетов, отличные от записей в package.json, то следует воспользоваться командой npm install
Пара примеров, обновим глабально Angular CLI и Storybook CLI
Обновим npm через npm в рамках минорной версии
Обновим npm через npm с переходом на последнюю мажорную версию
Обновление npm на windows 10
На windows есть определённые проблемы с обновлением, если npm установлен вместе с nodejs. В этом случае лучше воспользоваться npm-windows-upgrade. Правая кнопка мыши по меню «Пуск» -> запуск консоли от имени администратора.
Далее следует ввести 3 команды и следовать инструкциям
Дополнительная информация
Посмотреть версию установленного пакета
Посмотреть устаревшие пакеты
Посмотреть последнюю версию пакета в репозитарии npm (которая устанавливается по npm i )
version
Например, посмотреть версию последней альфы Storybook CLI
Downloading and installing Node.js and npm
To publish and install packages to and from the public npm registry or a private npm registry, you must install Node.js and the npm command line interface using either a Node version manager or a Node installer. 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.
Note: to download the latest version of npm, on the command line, run the following command:
npm install -g npm
Overview
- Checking your version of npm and Node.js
- Using a Node version manager to install Node.js and npm
- Using a Node installer to install Node.js and npm
Checking your version of npm and Node.js
To see if you already have Node.js and npm installed and check the installed version, run the following commands:
node -vnpm -v
Using a Node version manager to install Node.js and npm
Node version managers allow you to install and switch between multiple versions of Node.js and npm on your system so you can test your applications on multiple versions of npm to ensure they work for users on different versions.
OSX or Linux Node version managers
Windows Node version managers
Using a Node installer to install Node.js and npm
If you are unable to use a Node version manager, you can use a Node installer to install both Node.js and npm on your system.
- Node.js installer
- NodeSource installer
If you use Linux, we recommend that you use a NodeSource installer.
OS X or Windows Node installers
If you’re using OS X or Windows, use one of the installers from the Node.js download page. Be sure to install the version labeled LTS. Other versions have not yet been tested with npm.
Linux or other operating systems Node installers
If you’re using Linux or another operating system, use one of the following installers:
- NodeSource installer (recommended)
- One of the installers on the Node.js download page
Or see this page to install npm for Linux in the way many Linux developers prefer.
Less-common operating systems
For more information on installing Node.js on a variety of operating systems, see this page.
