Как установить node js на windows 10 через cmd

Как установить Node.js на Windows: пошаговая инструкция. Практические руководства для IT-специалистов. В Timeweb Cloud вы можете найти необходимую инструкцию или стать автором. Участвуйте в нашей контент-программе и внесите свой вклад в развитие сообщества.
  • Главная

  • Инструкции

  • Node.js

  • Как установить Node.js на Windows: пошаговая инструкция

На JavaScript выполняется большая часть интерактивных элементов на сайтах и в мобильных приложениях. JavaScript отлично работает с HTML/CSS и интегрирован основные браузеры на рынке. Чистый JavaScript используется в вебе, а для общего применения JavaScript разработчики используют различные среды выполнения, например, Node.js.

Node.js — это среда выполнения кода JavaScript. Она позволяет использовать JavaScript как язык программирования общего назначения: создавать на нем серверную часть и писать полноценные десктопные приложения.

Основа Node.js — движок V8. Этот движок был разработан Google и используется в браузере Google Chrome. Он компилирует код JavaScript в машинный код, который понимает процессор. Однако, чтобы сделать из JavaScript язык общего назначения, одного движка недостаточно. Так, например, для создания серверной части нужно, чтобы язык умел работать с файлами, сетью и т.п. Для решения этой проблемы разработчики добавили к V8 дополнительные возможности, с помощью своего кода и сторонних библиотек. В итоге у них получился инструмент, который превращает JavaScript в язык общего назначения.

Node.js стала популярна среди разработчиков благодаря возможности создавать серверную и клиентскую часть на одном языке, скорости работы и NPM. В этом материале мы расскажем, как правильно установить Node.js на Windows 10.

Удаление старых версий 

Перед установкой необходимо удалить старые версии среды выполнения, если они были ранее установлены. Наличие предыдущих версий может привести к возникновению конфликтов.

Проверим систему на наличие версий Node.js. Для этого в cmd (чтобы ее запустить, нажмите Win+R, введите cmd и нажмите Enter) выполняем команду nvm list:

C:UsersTimeweb>nvm list
    18.9.0
    18.8.0
    16.17.0

Как видим, у нас установлено несколько версий. Удалим их:

  1.  Выполняем команду npm cache clean --force.
  2. В «Установка и удаление программ» удаляем Node.js.
  3. Перезагружаем компьютер.
  4. Удаляем следующие каталоги. Некоторые из них могут существовать, а некоторые, наоборот, отсутствовать:
    • C:Program Files (x86)Nodejs
    • C:Program FilesNodejs
    • C:Users{User}AppDataRoamingnpm
    • C:Users{User}AppDataRoamingnpm-cache
    • C:Users{User}.npmrc
    • C:Users{User}AppDataLocalTempnpm-*
  5. Возвращаемся в командную строку и выполняем nvm uninstall к каждой версии, полученной с помощью nvm list:
C:UsersTimeweb>nvm uninstall 18.9.0
Uninstalling node v18.9.0... done

C:UsersTimeweb>nvm uninstall 18.8.0
Uninstalling node v18.9.0... done

C:UsersTimeweb>nvm uninstall 16.17.0
Uninstalling node v18.9.0... done

Дополнительно проверим, что версии удалены:

C:UsersTimeweb>nvm list
No installations recognized.

C:UsersTimeweb>where node
ИНФОРМАЦИЯ: не удается найти файлы по заданным шаблонам.

C:UsersTimeweb>where npm
ИНФОРМАЦИЯ: не удается найти файлы по заданным шаблонам.

С помощью nvm-windows

Node Version Manager или сокращенно NVM — это диспетчер версий Node.js. Возможно, во время работы вам придется использовать различные версии Node и переключаться между ними. Версии часто меняются, поэтому при работе рекомендуется использовать диспетчер версий.

NVM — самый распространенный диспетчер версий, но, к сожалению, в Windows он не доступен, и вместо него используется адаптированный вариант nvm-windows. 

  1. Зайдите в репозиторий nvm-windows на github.
  2. Загрузите установщик nvm-setup.exe последней версии диспетчера.
  3. После загрузки осуществите установку.
  4. По окончании работы установщика откройте PowerShell от имени администратора и проверьте работоспособность NVM:
PS C:Windowssystem32 > nvm list
No installations recognized.

Теперь нужно выбрать версию Node.js, которую вы будете устанавливать на свой компьютер. Команда nvm list available покажет частичный список доступных для загрузки версий:

Image4

Если для вашего проекта не требуется определенная версия, то рекомендуется выбрать последний LTS-выпуск. Риск возникновения проблем при работе с такой версией минимален. Если же вы хотите протестировать нововведения и улучшенные возможности, то вы можете загрузить последнюю версию. При этом не стоит забывать, что риск возникновения проблем с новейшей версией выше.

Установим последний LTS. Возьмем номер версии из результата nvm list available и установим его с помощью nvm install:

PS C:Windowssystem32> nvm install 16.17.0
Downloading node.js version 16.17.0 (64-bit)...
Extracting...
Complete
Creating C:UsersTimewebAppDataRoamingnvmtemp

Downloading npm version 8.15.0… Complete
Installing npm v8.15.0…

Installation complete. If you want to use this version, type

nvm use 16.17.0

Установка завершена. В ряде случаев при установке nvm-windows может возникнуть проблема: nvm не загрузит диспетчер пакетов NPM. В этом случае рекомендуем воспользоваться следующим способом установки.

Как установить node.js с помощью официального установщика

  1. Зайдите на официальный сайт nodejs.org в раздел «Загрузка».
  2. Выберите и загрузите нужную версию.
  3. По завершению загрузки откройте файл, после чего начнется установка.
  4. Следуйте инструкциям установщика.

Установка node.js в WSL2

Если вы хотите использовать Node.js вместе с Docker, планируете работать с командной строке Bash или просто любите Linux, то имеет смысл задуматься об установке среды выполнения в WSL2. 

WSL (Windows Subsystem for Linux) — это программная прослойка для запуска приложений, созданных под Linux-системы, на ОС Windows. Возможно, вам уже приходилось работать в WSL с приложениями, у которых нет Windows-версий. Ранее мы уже рассматривали установку Node.js на Ubuntu 20.04. Поэтому в этом разделе будет размещена инструкция по установке WSL 2 — об установке Node.js на Ubuntu читайте в статье «Как установить Node.js в Ubuntu 20.04»

Алгоритм установки WSL2 в Windows 10 зависит от версии операционной системы. Чтобы её узнать, нажмите Win+R и введите winver. После этого откроется такое окно: 

Image3

Алгоритм для версий старше 2004

В PowerShell от имени администратора выполняем следующие команды:

wsl --install 
wsl --set-version Ubuntu 2

Для проверки результата воспользуемся командой wsl.exe -l -v:

PS C:WINDOWSsystem32> wsl.exe -l -v
  NAME      STATE           VERSION
* Ubuntu    Stopped         2

Алгоритм для версий младше 2004 (как минимум потребуется ОС версии 1903)

В PowerShell (от имени администратора) активируем подсистему Windows для Linux.

dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart

Затем активируем функцию виртуальной машины:

dism.exe /online /enable-feature /featurename: VirtualMachinePlatform /all /norestart 

После выполнения этих действий нужно перезагрузить компьютер.

Когда компьютера запустится, скачиваем и устанавливаем пакет обновлений ядра Linux. Загрузить его можно по здесь.

В PowerShell выберем 2 версию WSL в качестве основной:

wsl --set-default-version 2

Теперь скачаем какую-нибудь операционную систему на Linux. Сделать это можно прямо магазине приложений Microsoft Store:

Image1

По окончании установки вы сможете зайти в консоль установленной системы через меню поиска:

Image2

Заключение

Node.js — это популярная среда разработки, которая используется множеством крупных компаний: PayPal, Yahoo, Ebay, General Electric, Microsoft и Uber. В рамках этого материала мы рассмотрели способы как установить Node.js на Windows 10. 

Node.js came as a blessing for JavaScript developers worldwide struggling with swapping among multiple languages and frameworks to amplify their code into a sustainable development environment.

With Node.js, you can finally build web applications with two-way connections where both the server-side and client-side can thoroughly communicate in real-time and exchange data. Indeed, Node.js has been revolutionary for developers who wanted to push real-time web applications over WebSocket.

If you’re aiming forward to enhancing your web development skills to the next level and becoming a full-stack JavaScript developer, Node.js indeed prepares the path towards that enthusiastic buzzword!

In this article, we’ll demonstrate a step-by-step guideline for installing Node.js on your computer and commencing with your web development journey.

What Is Node.js?

Nodejs official logo.

Node.js logo. (Image source: Node.js)

The first thing you should know is that Node.js is not a programming language!

You may already be aware of this fact, but it bears repeating for new developers in the field who may mistake Node.js for a unique programming language. It’s not!

Node.js is an open-source runtime environment for the JavaScript language that reshapes JavaScript’s characteristics and upgrades its functionality. As a result, you can use JavaScript for frontend and backend development, enabling full-stack development solely using JavaScript.

Initially, Node.js was designed to serve real-time performance, pushed-back architectures. But since then, Node.js has grown into a vital element for server-side programming for event-driven, non-blocking servers. Most conventional websites and API services today depend on Node.js.

Before Node.js, if you wanted to store any data on the database or connect your program to the database, you needed support from a server-side language. That’s because JavaScript couldn’t regulate the backend process. Consequently, you had to learn server-side languages like PHP, Python, Ruby, or C# — or seek a backend developer’s help.

The Node.js environment empowers JavaScript to directly employ the database and function properly as a backend language. As a result, you can ultimately build and run a program using only JavaScript with Node.js.

Node.js uses the V8 JavaScript runtime engine as its root power, and it employs a non-blocking I/O architecture that’s event-driven. All these together construct Node.js and help drive products towards robust performance.

Who Uses Node.js?

According to W3Techs, to date, 1.4% of all websites use Node.js — that’s more than 22 million websites. These numbers give you a general idea of the amount of Node.js users. On top of that, Node.js has been downloaded more than 1.3 billion times! As you can see, the stats speak strongly to Node.js’ market scale.

From your friends in IT to the industry tycoons, all are enjoying leveraging Node.js. That’s because Node.js amplifies the performance of developers and increases the speed of the development process. One of the most intelligent trends nowadays is using JavaScript everywhere, which has brought Node.js into the arena.

Top companies that use Node.js include:

  1. NASA
  2. Twitter
  3. Netflix
  4. LinkedIn
  5. PayPal
  6. Trello
  7. eBay
  8. Walmart
  9. Mozilla
  10. Medium

If you study these companies, you may notice that they run their businesses on different services or products. But they all have a critical factor in common: they rely on Node.js. Indeed, using Node.js can solve most of your development issues, never mind what industry you’re in.

Advantages of Using Node.js

Choosing the right programming platform for your tech stack is as important as the labor you want to invest in. Multiple factors should be considered when you look for the advantages of using a particular platform. Things like the learning curve, development speed, community, and scale can alter the overall balance of benefits.

Here are the main advantages of using Node.js:

  • Simple syntax
  • Easy learning curve
  • Ability to scale quickly
  • Open source and flexible
  • Cross-platform development
  • Single-language full-stack development
  • Real-time communication
  • Vast and active community

Node.js Prerequisites

Before installing Node.js, you need to ensure that you’ve gathered all the necessary bits of knowledge and downloaded all required installation files and elements.

Firstly, it would help if you had a basic understanding of JavaScript and its syntax — this will make picking up Node.js easier for you.

Secondly, a basic understanding of an object-oriented programming (OOP) language will help you work on server-side coding.

Lastly, rather than rushing into deep learning, take it one step at a time. Always remember that you’re not a day late or a dollar short as long as you’re progressing.

System Requirements

Node.js doesn’t require a fancy hardware setup to run; most computers of this era should handle Node.js efficiently. Even the most miniature computers like BeagleBone or Arduino YÚN can run Node.js.

Nevertheless, much still depends on what other memory hog software you’ve got running on the same system. But in most cases, you shouldn’t be worried unless your computer is from the Mesozoic Era!

LTS Version vs Current Version

Node.js offers two different versions for you to download: the LTS version and the Current version.

The first one is Long-Term Support (LTS), which indicates the version that has been in the market for a while and comes with all mandatory support. Consequently, you can access a bunch of information and community for additional help with this version.

This LTS version is recommended to most users because of its sustainability and 18-month-long support cycle. As it’s a stable version, using it to produce backends can help you achieve a robust outcome.

The Current version indicates the latest released version of Node with the most recently added and updated features. But this version has less support behind it (around eight months) and possible bug exposure. Therefore, experts suggest using this version only for frontend development.

Considering all these factors, if you’re a regular user who loves to live hassle-free, go for the LTS version. On the other hand, if you’re an advanced user who loves the adventure of experiencing new technology, you can choose to install the Current version.

How to Install Node.js and npm

Every operating system has a distinct method of installing Node.js. The core setup file differs for each OS to OS. However, the Node.js creators have taken care to provide you with the files needed for each system.

In the next portion of the article, we’ll discuss installing Node.js on Windows, macOS, and Linux operating systems.

How to Install Node.js on Windows

Follow this step-by-step guide to install Node.js on Windows.

1. Download Windows Installer

First, you need to download the Windows Installer (.msi) file from the official Node.js website. This MSI installer database carries a collection of installer files essential to install, update, or modify the existing Node.js version.

Notably, the installer also carries the Node.js package manager (npm) within it. It means you don’t need to install the npm separately.

When downloading, select the correct version as per your operating system. For example, if you’re using a 64-bit operating system, download the 64-bit version, and if you’re using the 32-bit version, download the 32-bit version:

Downloading the Node.js installer.

Downloading the Node.js installer.

2. Begin the Installation Process

Once you open and run the .msi file, the installation process begins. But you have to set a few parameters before running the installation process.

Double-click on the installer file and run it. The installer will ask you to accept the Node.js license agreement. To move forward, check the “I accept” box and click Next:

Accepting the Node.js license agreement.

Accepting the Node.js license agreement.

Then, select the destination where you want to install Node.js. If you don’t want to change the directory, go with the Windows default location and click the Next button again.

Selecting the appropriate Node.js installation folder.

Selecting the Node.js installation folder.

The next screen will show you custom setup options. If you want a standard installation with the Node.js default features, click the Next button. Otherwise, you can select your specific elements from the icons in the tree before clicking Next:

Using the Node.js installer's

“Custom Setup” options in the Node.js installer.

Node.js offers you options to install tools for native modules. If you’re interested in these, click the checkbox to mark your preferences, or click Next to move forward with the default:

Installing tools for native modules in None.js.

Tools for native modules in the Node.js installer.

3. Run Node.js Installation on Windows

Lastly — and this is the easiest part of all — click the Install button to begin the installation process:

Beginning the Node.js installation.

Beginning the Node.js installation.

The system will complete the installation within a few seconds or minutes and show you a success message. Click on the Finish button to close the Node.js installer.

Finishing the Node.js installation on Windows.

Finishing the Node.js installation on Windows.

4. Verify Node.js Installation

So the installation process is completed. Now, you have to check whether Node.js is successfully installed or not.

To verify the installation and confirm whether the correct version was installed, open your PC’s command prompt and enter the following command:

Node --version

And to check the npm version, run this command:

npm --version

Performing a Node.js npm version check on Windows.

Verifying Node.js installation on Windows.

If the Node.js version and npm are correctly installed, you’ll see the version name in the CMD prompt.

How To Install Node.js on macOS

Follow these step-by-step guidelines to install Node.js on macOS.

1. Download macOS Installer

Installing Node.js on macOS follows almost the same procedure as Windows. All you have to do is to download the installation file for Mac. Then, as soon as you start it up, the installer will walk you through the rest.

Firstly, download the macOS installer (.pkg) file from the Node.js website. There’s only a 64-bit version, so you don’t have to worry about which to download.

Downloading the Node.js macOS installer.

Downloading the Node.js macOS installer.

2. Begin Node.js Installation on macOS

Check your Download folder for the installer file and click on it to start the installation process.

The Node.js installer carries the Node.js core file, and, consequently, the installation process installs both Node.js and npm from the installer file. Therefore, you don’t need to install npm separately.

Then, click Continue to move forward with the installation.

Checking the Node.js macOS installation properties.

Node.js macOS installation properties.

You must agree to the terms of usage to install Node.js. Read through it before clicking the Agree button to continue if you’d like to explore the license agreement.

Accepting the Node.js license agreement on macOS.

Node.js macOS installation license agreement.

At this screen, you need to select the installation location. Usually, the OS determines a default installation location. If you have other requirements, you can change the location. Otherwise, keep the default location.

3. Run Node.js Installation on macOS

Until now, you’ve set all the preferences that are needed to install Node.js on macOS fully. Now click on the Install button to finish things up.

Selecting the Node.js installation location on macOS.

Selecting the Node.js installation location on macOS.

After a successful installation process, the system will show you a confirmation message. As npm is integrated within the Node.js installer, the notification should indicate proof of npm installation too.

Finally, click on the Close button to close the dialogue box.

Closing the Node.js installer on macOS.

Closing the Node.js installer.

4. Verify Node.js Installation on macOS

You’ve now successfully installed Node.js on your macOS. However, you should check to confirm that the installation process was successful and whether the Node.js and npm versions are working properly on your macOS.

To check the Node.js version, you need to open your macOS terminal, click the Command + Space keys, or search the terminal from the search bar.

Opening the macOs terminal.

Opening the macOS terminal.

To check the Node.js version, type:

Node --version

And to check the npm version, run this command:

npm --version

Verifying Node.js installation on macOS.

Verifying Node.js installation on macOS.

If the Node.js and npm versions are visible, both of them are correctly installed and working fine. If not, you may need to recheck to find the error or try the installation process again.

How To Install Node.js on Linux

The Linux operating system works a bit differently than the other traditional operating systems. That’s because Linux is open-source, offering you more freedom, customization, and advanced functionalities.

If you’re casual with commands, you should feel comfortable with Linux. Here, we are about to discuss the easiest method of installing Node.js on the Linux operating system.

1. Choose the Node.js Version for Your Linux Distribution

The Linux operating system has hundreds of different distributions because of the diversity it provides. And users love to customize and harness different versions’ specific functionalities using distinct distributions.

Firstly, find the installation instruction for your specific distribution from Node.js’s Binary Distributions page. For this guide, we’ll be using Ubuntu for illustration purposes.

Node.js Ubuntu installation instructions.

Node.js Ubuntu installation instructions.

2. Install the Curl Command-Line Tool

Before going for Node.js installation, ensure that you have the curl command-line utility installed on your system. If not, then paste this command on your terminal to install curl:

sudo apt install curl

It may ask for your system password to verify the permission of the installation. Once you input the password, the system should begin the curl installation.

Install "curl" on Ubuntu.

Installing “curl” on Ubuntu.

3. Start Node.js Installation

You need to copy and paste the Node.js installation command into your terminal (in our case, we can grab it from the Ubuntu distribution page) so that the system can begin the Node.js installation.

For instance, here, we’ll be installing Node.js v14.x. These are the installation commands for Ubuntu:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

As you already have the curl command line installed on your terminal, you’ll need to copy and paste the first command (the curl command) on your terminal and run it.

Beginning the Node.js installation on Ubuntu.

Beginning Node.js installation on Ubuntu.

The curl command begins the Node.js installation process, updates your system, and downloads all Node.js libraries required to install Node.js on your Linux OS.

Node.js library installation.

Node.js library installation.

Now, all the libraries and resources of Node.js have been downloaded to your PC. With one final command, we can finish installing Node.js and npm on your computer.

Copy and paste the second line of command from the installation instructions above into your Linux terminal:

sudo apt-get install -y nodejs

Node.js Ubuntu installation.

Installing Node.js on Ubuntu.

If you’ve done everything correctly, Node.js will install correctly on your Linux distribution. Now input the Clear command to clear the terminal.

4. Verify Node.js Installation on Linux Ubuntu distribution

As you’ve installed Node.js, you can verify to check whether the installation is successful or not. To confirm the installation, you need to run two simple Linux commands on your Linux terminal.

To check the Node.js version, type:

Node --version

And to check the npm version, type:

npm --version

Verifying Node.js installation on Ubuntu.

Verifying Node.js installation on Ubuntu.

If the Node.js version and npm are installed correctly, you’ll see the Node.js and npm version names visible on the Linux terminal. It indicates that you have successfully installed Node.js and npm on your Linux distribution.

Check and Update npm Version

As we’ve mentioned, npm is the Node.js package manager. It manages the dependencies for packages. Without npm, you would have to unpack all your Node.js packages manually every time you want to upload a framework. But npm relieves you of this responsibility and takes care of it automatically.

Regularly updating npm also updates your local packages and improves the code used in your projects. However, as npm automatically installs with the Node.js version you choose, it often misses the latest npm release. In such cases, you can check your npm version and update it manually in a simple process.

The processes to check and update your npm version are very similar between Windows, macOS, and Linux — you’ll be running the same command on each.

Update npm in Windows

To check the npm version, run the following command:

npm -v

…or:

npm --version

And to update the npm version, run this command:

npm install -g [email protected]

After running this command on your CMD prompt on Windows, the system will update your npm version and install the additional packages in a few seconds. In the end, you can recheck the version to confirm the update of the npm version.

Updating npm version on Windows.

Updating npm on Windows.

Update npm on macOS

To check the npm version on macOS, open your terminal and run the following command:

npm -v

…or:

npm --version

Checking npm version on macOS.

Checking npm version on macOS.

To update the npm version, run this command in your macOS terminal:

npm install -g [email protected]

update npm on macOS.

Updating npm on macOS.

Update npm in Linux

To update your npm version on Linux, type these commands into your terminal:

sudo npm install -g n

…and then:

sudo n latest

Updating npm version on ubuntu.

Updating npm on Ubuntu.

With Node.js, you can take your web dev skills to the next level 📈… so what are you waiting for? Get started with this guide 👇Click to Tweet

Summary

Node.js has become a popular programming environment quickly because of its usefulness in both frontend and backend. Thousands of active users have created a vast community that helps keep new developers and their questions from slipping through the cracks.

In essence, it’s easy to start with Node.js because of its simplicity, and its capabilities for creating advanced applications are extraordinary. It can also help turn you into a full-stack developer in a short time. These features make Node.js an inevitable choice for next-generation programming.

Have we missed any helpful tips about installing Node.js on Windows, macOS, or Linux? Let us know in the comments section!


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

Node.js came as a blessing for JavaScript developers worldwide struggling with swapping among multiple languages and frameworks to amplify their code into a sustainable development environment.

With Node.js, you can finally build web applications with two-way connections where both the server-side and client-side can thoroughly communicate in real-time and exchange data. Indeed, Node.js has been revolutionary for developers who wanted to push real-time web applications over WebSocket.

If you’re aiming forward to enhancing your web development skills to the next level and becoming a full-stack JavaScript developer, Node.js indeed prepares the path towards that enthusiastic buzzword!

In this article, we’ll demonstrate a step-by-step guideline for installing Node.js on your computer and commencing with your web development journey.

What Is Node.js?

Nodejs official logo.

Node.js logo. (Image source: Node.js)

The first thing you should know is that Node.js is not a programming language!

You may already be aware of this fact, but it bears repeating for new developers in the field who may mistake Node.js for a unique programming language. It’s not!

Node.js is an open-source runtime environment for the JavaScript language that reshapes JavaScript’s characteristics and upgrades its functionality. As a result, you can use JavaScript for frontend and backend development, enabling full-stack development solely using JavaScript.

Initially, Node.js was designed to serve real-time performance, pushed-back architectures. But since then, Node.js has grown into a vital element for server-side programming for event-driven, non-blocking servers. Most conventional websites and API services today depend on Node.js.

Before Node.js, if you wanted to store any data on the database or connect your program to the database, you needed support from a server-side language. That’s because JavaScript couldn’t regulate the backend process. Consequently, you had to learn server-side languages like PHP, Python, Ruby, or C# — or seek a backend developer’s help.

The Node.js environment empowers JavaScript to directly employ the database and function properly as a backend language. As a result, you can ultimately build and run a program using only JavaScript with Node.js.

Node.js uses the V8 JavaScript runtime engine as its root power, and it employs a non-blocking I/O architecture that’s event-driven. All these together construct Node.js and help drive products towards robust performance.

Who Uses Node.js?

According to W3Techs, to date, 1.4% of all websites use Node.js — that’s more than 22 million websites. These numbers give you a general idea of the amount of Node.js users. On top of that, Node.js has been downloaded more than 1.3 billion times! As you can see, the stats speak strongly to Node.js’ market scale.

From your friends in IT to the industry tycoons, all are enjoying leveraging Node.js. That’s because Node.js amplifies the performance of developers and increases the speed of the development process. One of the most intelligent trends nowadays is using JavaScript everywhere, which has brought Node.js into the arena.

Top companies that use Node.js include:

  1. NASA
  2. Twitter
  3. Netflix
  4. LinkedIn
  5. PayPal
  6. Trello
  7. eBay
  8. Walmart
  9. Mozilla
  10. Medium

If you study these companies, you may notice that they run their businesses on different services or products. But they all have a critical factor in common: they rely on Node.js. Indeed, using Node.js can solve most of your development issues, never mind what industry you’re in.

Advantages of Using Node.js

Choosing the right programming platform for your tech stack is as important as the labor you want to invest in. Multiple factors should be considered when you look for the advantages of using a particular platform. Things like the learning curve, development speed, community, and scale can alter the overall balance of benefits.

Here are the main advantages of using Node.js:

  • Simple syntax
  • Easy learning curve
  • Ability to scale quickly
  • Open source and flexible
  • Cross-platform development
  • Single-language full-stack development
  • Real-time communication
  • Vast and active community

Node.js Prerequisites

Before installing Node.js, you need to ensure that you’ve gathered all the necessary bits of knowledge and downloaded all required installation files and elements.

Firstly, it would help if you had a basic understanding of JavaScript and its syntax — this will make picking up Node.js easier for you.

Secondly, a basic understanding of an object-oriented programming (OOP) language will help you work on server-side coding.

Lastly, rather than rushing into deep learning, take it one step at a time. Always remember that you’re not a day late or a dollar short as long as you’re progressing.

System Requirements

Node.js doesn’t require a fancy hardware setup to run; most computers of this era should handle Node.js efficiently. Even the most miniature computers like BeagleBone or Arduino YÚN can run Node.js.

Nevertheless, much still depends on what other memory hog software you’ve got running on the same system. But in most cases, you shouldn’t be worried unless your computer is from the Mesozoic Era!

LTS Version vs Current Version

Node.js offers two different versions for you to download: the LTS version and the Current version.

The first one is Long-Term Support (LTS), which indicates the version that has been in the market for a while and comes with all mandatory support. Consequently, you can access a bunch of information and community for additional help with this version.

This LTS version is recommended to most users because of its sustainability and 18-month-long support cycle. As it’s a stable version, using it to produce backends can help you achieve a robust outcome.

The Current version indicates the latest released version of Node with the most recently added and updated features. But this version has less support behind it (around eight months) and possible bug exposure. Therefore, experts suggest using this version only for frontend development.

Considering all these factors, if you’re a regular user who loves to live hassle-free, go for the LTS version. On the other hand, if you’re an advanced user who loves the adventure of experiencing new technology, you can choose to install the Current version.

How to Install Node.js and npm

Every operating system has a distinct method of installing Node.js. The core setup file differs for each OS to OS. However, the Node.js creators have taken care to provide you with the files needed for each system.

In the next portion of the article, we’ll discuss installing Node.js on Windows, macOS, and Linux operating systems.

How to Install Node.js on Windows

Follow this step-by-step guide to install Node.js on Windows.

1. Download Windows Installer

First, you need to download the Windows Installer (.msi) file from the official Node.js website. This MSI installer database carries a collection of installer files essential to install, update, or modify the existing Node.js version.

Notably, the installer also carries the Node.js package manager (npm) within it. It means you don’t need to install the npm separately.

When downloading, select the correct version as per your operating system. For example, if you’re using a 64-bit operating system, download the 64-bit version, and if you’re using the 32-bit version, download the 32-bit version:

Downloading the Node.js installer.

Downloading the Node.js installer.

2. Begin the Installation Process

Once you open and run the .msi file, the installation process begins. But you have to set a few parameters before running the installation process.

Double-click on the installer file and run it. The installer will ask you to accept the Node.js license agreement. To move forward, check the “I accept” box and click Next:

Accepting the Node.js license agreement.

Accepting the Node.js license agreement.

Then, select the destination where you want to install Node.js. If you don’t want to change the directory, go with the Windows default location and click the Next button again.

Selecting the appropriate Node.js installation folder.

Selecting the Node.js installation folder.

The next screen will show you custom setup options. If you want a standard installation with the Node.js default features, click the Next button. Otherwise, you can select your specific elements from the icons in the tree before clicking Next:

Using the Node.js installer's

“Custom Setup” options in the Node.js installer.

Node.js offers you options to install tools for native modules. If you’re interested in these, click the checkbox to mark your preferences, or click Next to move forward with the default:

Installing tools for native modules in None.js.

Tools for native modules in the Node.js installer.

3. Run Node.js Installation on Windows

Lastly — and this is the easiest part of all — click the Install button to begin the installation process:

Beginning the Node.js installation.

Beginning the Node.js installation.

The system will complete the installation within a few seconds or minutes and show you a success message. Click on the Finish button to close the Node.js installer.

Finishing the Node.js installation on Windows.

Finishing the Node.js installation on Windows.

4. Verify Node.js Installation

So the installation process is completed. Now, you have to check whether Node.js is successfully installed or not.

To verify the installation and confirm whether the correct version was installed, open your PC’s command prompt and enter the following command:

Node --version

And to check the npm version, run this command:

npm --version

Performing a Node.js npm version check on Windows.

Verifying Node.js installation on Windows.

If the Node.js version and npm are correctly installed, you’ll see the version name in the CMD prompt.

How To Install Node.js on macOS

Follow these step-by-step guidelines to install Node.js on macOS.

1. Download macOS Installer

Installing Node.js on macOS follows almost the same procedure as Windows. All you have to do is to download the installation file for Mac. Then, as soon as you start it up, the installer will walk you through the rest.

Firstly, download the macOS installer (.pkg) file from the Node.js website. There’s only a 64-bit version, so you don’t have to worry about which to download.

Downloading the Node.js macOS installer.

Downloading the Node.js macOS installer.

2. Begin Node.js Installation on macOS

Check your Download folder for the installer file and click on it to start the installation process.

The Node.js installer carries the Node.js core file, and, consequently, the installation process installs both Node.js and npm from the installer file. Therefore, you don’t need to install npm separately.

Then, click Continue to move forward with the installation.

Checking the Node.js macOS installation properties.

Node.js macOS installation properties.

You must agree to the terms of usage to install Node.js. Read through it before clicking the Agree button to continue if you’d like to explore the license agreement.

Accepting the Node.js license agreement on macOS.

Node.js macOS installation license agreement.

At this screen, you need to select the installation location. Usually, the OS determines a default installation location. If you have other requirements, you can change the location. Otherwise, keep the default location.

3. Run Node.js Installation on macOS

Until now, you’ve set all the preferences that are needed to install Node.js on macOS fully. Now click on the Install button to finish things up.

Selecting the Node.js installation location on macOS.

Selecting the Node.js installation location on macOS.

After a successful installation process, the system will show you a confirmation message. As npm is integrated within the Node.js installer, the notification should indicate proof of npm installation too.

Finally, click on the Close button to close the dialogue box.

Closing the Node.js installer on macOS.

Closing the Node.js installer.

4. Verify Node.js Installation on macOS

You’ve now successfully installed Node.js on your macOS. However, you should check to confirm that the installation process was successful and whether the Node.js and npm versions are working properly on your macOS.

To check the Node.js version, you need to open your macOS terminal, click the Command + Space keys, or search the terminal from the search bar.

Opening the macOs terminal.

Opening the macOS terminal.

To check the Node.js version, type:

Node --version

And to check the npm version, run this command:

npm --version

Verifying Node.js installation on macOS.

Verifying Node.js installation on macOS.

If the Node.js and npm versions are visible, both of them are correctly installed and working fine. If not, you may need to recheck to find the error or try the installation process again.

How To Install Node.js on Linux

The Linux operating system works a bit differently than the other traditional operating systems. That’s because Linux is open-source, offering you more freedom, customization, and advanced functionalities.

If you’re casual with commands, you should feel comfortable with Linux. Here, we are about to discuss the easiest method of installing Node.js on the Linux operating system.

1. Choose the Node.js Version for Your Linux Distribution

The Linux operating system has hundreds of different distributions because of the diversity it provides. And users love to customize and harness different versions’ specific functionalities using distinct distributions.

Firstly, find the installation instruction for your specific distribution from Node.js’s Binary Distributions page. For this guide, we’ll be using Ubuntu for illustration purposes.

Node.js Ubuntu installation instructions.

Node.js Ubuntu installation instructions.

2. Install the Curl Command-Line Tool

Before going for Node.js installation, ensure that you have the curl command-line utility installed on your system. If not, then paste this command on your terminal to install curl:

sudo apt install curl

It may ask for your system password to verify the permission of the installation. Once you input the password, the system should begin the curl installation.

Install "curl" on Ubuntu.

Installing “curl” on Ubuntu.

3. Start Node.js Installation

You need to copy and paste the Node.js installation command into your terminal (in our case, we can grab it from the Ubuntu distribution page) so that the system can begin the Node.js installation.

For instance, here, we’ll be installing Node.js v14.x. These are the installation commands for Ubuntu:

curl -fsSL https://deb.nodesource.com/setup_14.x | sudo -E bash -
sudo apt-get install -y nodejs

As you already have the curl command line installed on your terminal, you’ll need to copy and paste the first command (the curl command) on your terminal and run it.

Beginning the Node.js installation on Ubuntu.

Beginning Node.js installation on Ubuntu.

The curl command begins the Node.js installation process, updates your system, and downloads all Node.js libraries required to install Node.js on your Linux OS.

Node.js library installation.

Node.js library installation.

Now, all the libraries and resources of Node.js have been downloaded to your PC. With one final command, we can finish installing Node.js and npm on your computer.

Copy and paste the second line of command from the installation instructions above into your Linux terminal:

sudo apt-get install -y nodejs

Node.js Ubuntu installation.

Installing Node.js on Ubuntu.

If you’ve done everything correctly, Node.js will install correctly on your Linux distribution. Now input the Clear command to clear the terminal.

4. Verify Node.js Installation on Linux Ubuntu distribution

As you’ve installed Node.js, you can verify to check whether the installation is successful or not. To confirm the installation, you need to run two simple Linux commands on your Linux terminal.

To check the Node.js version, type:

Node --version

And to check the npm version, type:

npm --version

Verifying Node.js installation on Ubuntu.

Verifying Node.js installation on Ubuntu.

If the Node.js version and npm are installed correctly, you’ll see the Node.js and npm version names visible on the Linux terminal. It indicates that you have successfully installed Node.js and npm on your Linux distribution.

Check and Update npm Version

As we’ve mentioned, npm is the Node.js package manager. It manages the dependencies for packages. Without npm, you would have to unpack all your Node.js packages manually every time you want to upload a framework. But npm relieves you of this responsibility and takes care of it automatically.

Regularly updating npm also updates your local packages and improves the code used in your projects. However, as npm automatically installs with the Node.js version you choose, it often misses the latest npm release. In such cases, you can check your npm version and update it manually in a simple process.

The processes to check and update your npm version are very similar between Windows, macOS, and Linux — you’ll be running the same command on each.

Update npm in Windows

To check the npm version, run the following command:

npm -v

…or:

npm --version

And to update the npm version, run this command:

npm install -g [email protected]

After running this command on your CMD prompt on Windows, the system will update your npm version and install the additional packages in a few seconds. In the end, you can recheck the version to confirm the update of the npm version.

Updating npm version on Windows.

Updating npm on Windows.

Update npm on macOS

To check the npm version on macOS, open your terminal and run the following command:

npm -v

…or:

npm --version

Checking npm version on macOS.

Checking npm version on macOS.

To update the npm version, run this command in your macOS terminal:

npm install -g [email protected]

update npm on macOS.

Updating npm on macOS.

Update npm in Linux

To update your npm version on Linux, type these commands into your terminal:

sudo npm install -g n

…and then:

sudo n latest

Updating npm version on ubuntu.

Updating npm on Ubuntu.

With Node.js, you can take your web dev skills to the next level 📈… so what are you waiting for? Get started with this guide 👇Click to Tweet

Summary

Node.js has become a popular programming environment quickly because of its usefulness in both frontend and backend. Thousands of active users have created a vast community that helps keep new developers and their questions from slipping through the cracks.

In essence, it’s easy to start with Node.js because of its simplicity, and its capabilities for creating advanced applications are extraordinary. It can also help turn you into a full-stack developer in a short time. These features make Node.js an inevitable choice for next-generation programming.

Have we missed any helpful tips about installing Node.js on Windows, macOS, or Linux? Let us know in the comments section!


Get all your applications, databases and WordPress sites online and under one roof. Our feature-packed, high-performance cloud platform includes:

  • Easy setup and management in the MyKinsta dashboard
  • 24/7 expert support
  • The best Google Cloud Platform hardware and network, powered by Kubernetes for maximum scalability
  • An enterprise-level Cloudflare integration for speed and security
  • Global audience reach with up to 35 data centers and 275 PoPs worldwide

Test it yourself with $20 off your first month of Application Hosting or Database Hosting. Explore our plans or talk to sales to find your best fit.

I am creating a package installer which has nodejs, redis, and socket.io as prerequisites. The problem is that I don’t want the developers to install the prerequisites own their own.

I figured out a way of doing that using on mac and ubuntu by including brew install node for mac
and sudo apt-get install nodejs, sudo apt-get install npm

I am now looking for a way to install nodejs on window using a command or two.
Any Idea? Please.

asked Aug 10, 2017 at 0:15

Kamga Simo Junior's user avatar

5

You can install using this msiexec, select the version that’s most suitable for you in the link

msiexec.exe /a https://nodejs.org/dist/v8.3.0/node-v8.3.0-x64.msi /quiet

answered Aug 10, 2017 at 4:15

Kalana Demel's user avatar

Kalana DemelKalana Demel

3,1803 gold badges21 silver badges33 bronze badges

1

Nodejs Alternative For Windows

Using Chocolatey:

cinst nodejs

or for full install with npm

cinst nodejs.install

Using Scoop:

scoop install nodejs

answered Jun 6, 2019 at 12:05

Naga Lokesh Kannumoori's user avatar

1

You could use:

cinst nodejs.install

This is great install with npm.

answered Jan 15, 2020 at 9:50

Alireza Abdollahnejad's user avatar

Install nodejs version 8.10.0 on window

  1. download the installer from the url given below

    • https://nodejs.org/download/release/v8.10.0/
    • download .mis file from this page
    • you can download all versions form this url just by changing version number in the end of url

2.Install Angular 6 on window

  • Open command line as administrator
  • run below command in command line

    npm install -g @angular/cli@6

answered Jun 6, 2019 at 8:39

vishal sabnis's user avatar

I was running in the ServerCore windows container on Gitlab so the msiexec.exe did not work for me. However found another answer that did work over here from user Witcher: Docker + Node.js + Windows

The commands in the container that ended up working in my gitlab yml file before_script were:

Invoke-WebRequest 'https://nodejs.org/dist/v18.12.0/node-v18.12.0-win-x64.zip' OutFile 'C:/nodejs.zip'

Expand-Archive C:nodejs.zip -DestinationPath C:

Rename-Item "C:\node-v18.12.0-win-x64" C:nodejs

$Env:Path += ";C:nodejs"

This is downloading the Zip file from Nodejs’s site to the root of C, expanding the archive, and setting the nodejs path to the environment path variable so the «npm» command is recognized.

answered Oct 27, 2022 at 20:51

Khoward's user avatar

KhowardKhoward

1711 silver badge4 bronze badges

In this article , We are going to perform Download Node.js for Windows, How to Install Node.js on Windows 10, update the node.js and npm on windows, creating node.js app on windows, uninstalling node.js from windows 10.

What is Node.js ?

Node.js is free and an open-source cross-platform JavaScript run-time environment that allows server-side execution of JavaScript code. It is used in developing web and networking applications

What is NPM (Node Package Manager) ?

NPM (Node Package Manager) is command line tool for Node.js packages that installs, updates and uninstall packages in your projects.We don’t have install npm separately it is includes with Node.js installation.

Prerequisite

  • Windows 10 with Administrator Access

Step #1: Download Node.js package for Windows

First download the latest node.js package from node.js official site and click on Windows installer, it will download .msi file.

Click on 32 bit or 64 bit version of node.js for windows.

How to Install Node.js on Windows 10 [4 Steps] 1

once you clicked, it will ask for to save dowloaded node.js msi setup, click on Save File.

How to Install Node.js on Windows 10 [4 Steps] 2

once downloaded, double click on node.js Windows Installed .msi file.

you will see Node.js Setup Wizard , click on Next as shown below.

How to Install Node.js on Windows 10 [4 Steps] 3

click on Node.js License agreement and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 4

Select Destination folder where you want to Install Node.js and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 5

Select on to install npm modules like python and Visual Studio Build Tools if not installed and click on Next

How to Install Node.js on Windows 10 [4 Steps] 6

custom setup for Node.js and click on Next.

How to Install Node.js on Windows 10 [4 Steps] 7

Now Install Node.js on Windows 10, click on Install.

How to Install Node.js on Windows 10 [4 Steps] 8

wait to finish to Install Node.js on Windows.

How to Install Node.js on Windows 10 [4 Steps] 9

once installing of Node.js finished, click on Finish.

How to Install Node.js on Windows 10 [4 Steps] 10

It will open commands prompt to Install Addition Tools for Node.js for Windows, click Enter.

How to Install Node.js on Windows 10 [4 Steps] 11

once you entered, it will open Windows Powers shell and wait till to Install additional Tools for Node.js.

once all finished, open a commands prompt .

Check Node.js and npm version on Windows.

How to Install Node.js on Windows 10 [4 Steps] 12

Note: when you install node.js using msi installed, you don’t need to setup system variables for node.js.

Step #3: How to Update Node.js and NPM on Windows

To update node.js and npm on windows , you can download the node.js version from the node.js official site , install and replace it with existing version.

OR

open a commands prompt and run below commands to update the node.js and npm on windows

npm install npm –global

Output:

C:UsersfosstechnixAppDataRoamingnpmnpm -> C:UsersfosstechnixAppDataRoamingnpmnode_modulesnpmbinnpm-cli.js
C:UsersfosstechnixAppDataRoamingnpmnpx -> C:UsersfosstechnixAppDataRoamingnpmnode_modulesnpmbinnpx-cli.js
+ npm@6.14.8
added 434 packages from 885 contributors in 8.878s

Step #4: Create a Node.js Application on Windows

Create a javascript file with name nodeapp.js in C:Usersyour name location, add below code which prints ” Hello World”.

sudo nano nodeapp.js

Paste the below lines into it.

const http = require('http');

const hostname = '127.0.0.1';
const port = 3000;

const server = http.createServer((req, res) => {
  res.statusCode = 200;
  res.setHeader('Content-Type', 'text/plain');
  res.end('Hello Worldn');
});

  server.listen(port, hostname, () => {
  console.log(`Server running at http://${hostname}:${port}/`);
});

Run your Node.js server with the below command,

node nodeapp.js

Output:

 node nodeapp.js

Server running at http://127.0.0.1:3000/

Now open your browser and type server name or IP followed by port 3000, you will see Hello World message.

http://localhost:3000/

you will see “Hello World” Message on your browser.

How to Uninstall/Remove Node.js and NPM from Windows

To Uninstall or completely Remove Node.js and NPM from Windows 10.

1. Open the Control Panel

2. click on Programs and Features

3. Select Node.js

4. click on Uninstall Button

It will ask to confirm uninstall node.js from Windows.

Conclusion:

In this article, We have performed, Download Node.js for Windows, How to Install Node.js on Windows 10, update the node.js and npm on windows, creating node.js app on windows, running and testing node.js app, uninstalling node.js from windows 10.

Related Articles

How to Install Node.js and NPM on Ubuntu 20.04 LTS

How to Install Latest Node.js and NPM on Ubuntu 19.04,18.04/16.04 LTS

How to Install Angular CLI on Ubuntu 18.04/16.04 LTS

How to Install node.js on Mac OS

У меня на компьютере установлена операционная система «Windows 10 Pro» (64-разрядная).

Установка «в лоб»

Заходим на официальный сайт среды выполнения «Node.js»:

https://nodejs.org/en/
https://nodejs.org/ru/

Я зашел на первую ссылку (англоязычный вариант сайта). У меня сразу на открывшейся странице написано: «Download for Windows (x64)». Как я понимаю, сайт определяет операционную систему пользователя автоматически. Под этим заголовком две большие зеленые кнопки:

16.13.0 LTS (Recommended For Most Users)
17.2.0 Current (Latest Features)

Понятно, что первая кнопка — для скачивания самой свежей рекомендуемой (стабильной) на сегодня версии среды. А вторая кнопка — для скачивания самой свежей экспериментальной версии среды.

Я выбрал первый вариант. После нажатия на эту кнопку начинается закачка на компьютер файла-дистрибутива «node-v16.13.0-x64.msi». (Файлы с расширением «.msi» — это установочные пакеты в операционных системах «Windows». При их запуске они обрабатываются подсистемой операционной системы «Windows», обеспечивающей установку программ. Вообще, «msi» — это сокращение от «Microsoft Installer» [по-русски «установщик программ от фирмы Microsoft»].) После закачки этого файла на компьютер я его запустил и быстро прощелкал все пункты установки, оставляя везде выборы по умолчанию.

В конце установщик сообщил, что установка закончена успешно.

* * *

Как проверить, что среда выполнения «Node.js» установлена и работает? Вообще, нужно понимать, что работа со средой выполнения «Node.js» выполняется через интерфейс командной строки, а не как мы (пользователи операционной системы «Windows») привыкли — не через графический оконный интерфейс.

То есть можно зайти в командную строку (cmd.exe) операционной системы «Windows 10 Pro» и ввести команду «node»:

Как видно на иллюстрации, среда выполнения «Node.js» отреагировала на введенную команду. Очевидно, что если она реагирует, значит, она установлена. В противном случае командная строка сообщила бы об отсутствии вызываемой командой «node» программы.

Почему среда выполнения «Node.js» успешно вызывается из любого каталога (папки)? На иллюстрации видно, что я не переходил в каталог, в который была установлена среда выполнения «Node.js», а запуск этой программы всё равно был выполнен успешно. Дело в том, что при установке среды выполнения «Node.js» установщик прописал путь к каталогу, в который была установлена эта среда выполнения, в переменную среды (в данном случае под словом «среда» подразумевается операционная система «Windows 10 Pro») PATH. Это даёт возможность запускать среду выполнения «Node.js» из любого каталога, не указывая полного пути к исполняемому файлу этой среды выполнения.

https://ru.wikipedia.org/wiki/PATH_(переменная)

Кроме запуска из командной строки (cmd.exe) среду выполнения «Node.js» можно запустить из программы «Windows PowerShell» (которая, как я понимаю, позиционируется как замена классической командной строки «cmd.exe»):

Кроме этого следует знать, что установщик создал в меню кнопки «Пуск» операционной системы новую папку «Node.js», в которую поместил шесть файлов-ярлыков. Запустить среду выполнения «Node.js» можно и оттуда. Названия этих ярлыков:

1. Install Additional Tools for Node.js
2. Node.js command prompt
3. Node.js documentation
4. Node.js website
5. Node.js
6. Uninstall Node.js

Вот что они делают:

1. C:WindowsSystem32cmd.exe /d /c "C:Program Filesnodejsinstall_tools.bat"
2. C:WindowsSystem32cmd.exe /k "C:Program Filesnodejsnodevars.bat"
3. Открывает в браузере https://nodejs.org/download/release/v16.13.0/docs/api/
4. Открывает в браузере https://nodejs.org/
5. "C:Program Filesnodejsnode.exe"
6. Вызывает "C:WindowsSysWOW64msiexec.exe" с соответствующими ключами.

Пока не знаю, что они там понаписали в пунктах 1 и 2. Прежде, чем их использовать, нужно разобраться, что там прописано в пакетных файлах с расширением «.bat». Пункт 5 — это, думаю, аналог запуска среды выполнения «Node.js» из командной строки «cmd.exe». С пунктами 3 и 4 всё просто, они открывают указанные адреса в браузере. Пункт 6 — это запуск упомянутой выше подсистемы операционной системы «Windows», которая устанавливает программы. В данном случае эта же подсистема используется для удаления программы из операционной системы.

Продолжение тут.

Node.js is a cross-platform environment that runs and executes JavaScript codes outside the browser. Since its first release, Node.js has gained massive popularity among developers. As it uses JavaScript, it is fast and easy to pick up and avails excellent scalability, making it a favourite among web developers. The Node.js framework is available for all the major operating systems like Windows, Ubuntu, and Mac. To know more, check out KnoweldgeHut Full Stack Developer review.   

s-logo.jpg 

Are you ready to start working with node.js? Before anything else, let us understand how to install node.js on windows 10. 

In this tutorial, you will learn- 

  • How to Download & Install Node.js on Windows 10 
  • How to uninstall Node.js on windows 
  • How to Install NPM on Windows 10 
  • Running your first «Hello World» application in Node.js 

Prerequisites

Below we get started, here are a few system requirements to download, install, and set up React-Native on Windows 10. 

Hardware requirements

  • RAM 4GB 
  • CPU Intel Core i3TM i3 HQ CPU @2.50 GHz 
  • ROM 256 GB 

Software requirement

  • Chocolatey 

Attention: You will also need a stable internet connection because we will be downloading most of this software. 

Installation procedure

  • Step-by-step procedure to Install node.js on Windows 10

Undoubtedly, the first step to getting started on working with node.js is installing the software package in your system. Once done, follow the step-by-step tutorial on how to proceed to get the node.js framework successfully installed in your system. We will also look at how you can uninstall the program from your computer completely.

Step-1: Download node.js installer into your system

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.

Download node.js installer into your system

Note: When you click on download, you will be asked to choose the file location you want to store the instal.msi binary files. Choose a secure file location of your choice.   

Download node.js installer into your system

Step-2: Run the installation

Once you choose the path, the next step is to double-click the instal.msi binary files to initiate the installation process. Furthermore, you will be asked for permission to run the application.   

Warning: On the open file security warning, there is a cancel option as well. Don’t click on the cancel option, or else you may perhaps need to restart the installation. You can use the back button to check your previous installation step. 

On running the application, you will proceed to an interface with a welcome message. Click the «Next» button and proceed with the installation as shown in the image. 

Run the installation

Step-3: Accept the terms of usage

Accept the terms of usage

After clicking the next option, you will get an end-user license agreement. Read the terms of using the software, and then click on next.  

N.B. You will find a square box asking you to agree with the terms, and only when you have read the terms, you will be allowed to proceed further.  

Step-4: Specify the path 

Once you have accepted the terms and conditions, the next step is to specify the path where you want to install node.js. Your file location is the path where you must install the node.js in your system. Before we proceed further, you can enroll in Web Design Training to accelerate your career.   

Specify the path

Once you have specified the path, click on the Next button to proceed with the installation. 

Step-5: Select the default options

On proceeding with the Next option, the custom page setup will open up on the screen. Here you will get four icons as stated below: 

  • node.js runtime 
  • NPM package manager 
  • Online documentation shortcuts 
  • Add to PATH

Select the default options

Select all the options as default and then proceed with the Next option. 

Step-6 Initiate the installation

After all these steps, you will see an install button to process the installation of node.js on Windows. Click on the install button to initiate the installation of node.js on your Windows. Based on your system performance it may take a couple of minutes to install node.js on your system. Once the installation is complete, you will get a message on your screen as — Node.js has been successfully installed.

Initiate the installation

Step-7: Complete the installation

On clicking the Finish button, the process of installation of node.js is successfully completed. Congratulations! You have successfully installed node.js on your Windows 10. 

Complete the installation

Verifying the install 

To verify that the node.js has been successfully installed in your system, go to the command prompt and run it as administrator. Now use the following command to check the node.js version installed in your system. 

node -v 

The message v14.16.1 verifies that node.js has been successfully installed on your windows, and you are ready to use it. 

Installation of Node.js and NPM on Windows 10

Alternative Method

Do you know there is also an alternative way to download & install Node.js and NPM on Windows 10? Using a software package manager called Chocolatey, you can install node.js and NPM on your machine. Let us understand how to install node.js and NPM on windows using Chocolatey step by step. We will also look at how to uninstall the same with Chocolatey. 

Installing Chocolatey.

The first process that you need to do is to install Chocolatey in your system. Take a note that the installation of Chocolatey requires administrator access to the computer’s command prompt to run.  

  • Choose the option – get started as shown below:

Installing Chocolatey.

  • Once you go to the official Chocolatey website, select the individual as shown in the picture.  

Installing Chocolatey.

  • Open Windows PowerShell and run as administrator. Now run the command and then press enter. 

Get-ExecutionPolicy 

  • On running this command, you will get a message as Restricted. Once you get the message as Restricted, continue and then run another command and press enter. 

Set-Execution Policy All Signed

Installation of Node.js and NPM on Windows 10

  • You will get a screen with execution policy changes. Select the A (Yes to all) option and then press Enter.

Installation of Node.js and NPM on Windows 10

  • Copy and paste the command mentioned below: 
Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol =[System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))

Installation of Node.js and NPM on Windows 10

To check whether you have installed it well, open the command prompt below: 

choco -version 

If you have installed it well, you will see the display of the Chocolatey version you have installed on the screen as below: 

Installation of Node.js and NPM on Windows 10

Boom! Chocolatey is now successfully installed in your system. 

Install Node.js 

Using Chocolatey that you have just installed, now we can install Node.js in the system. Open the command prompt as the administrator and put in the Chocolatey command prompt as mentioned below:  

Choco install -y nodejs.install 

To confirm if it has installed correctly on the computer, you need to execute the command below on the computer command prompt, as an administrator: 

node --version 

Installation of Node.js and NPM on Windows 10

If you have followed the steps correctly, the installation would have been successful and the message below will display on your screen after the installation has been completed. 

After installing the Node.js, the Node Package Manager NPM automatically gets installed in the system. Run the command below to check the installation of NPM. The displayed message below verifies that the installation of NPM is successful.

Installation of Node.js and NPM on Windows 10

Writing your first program on node.js 

Now that you have successfully downloaded and installed node.js in your system, let’s learn how to write a program using node.js  

Follow the steps to write your first program. 

  • Step-1: Create a folder and name it. (Here we have created a folder named Node Programs. 
  • Step-2: Open any code editor of your choice (here we are using Visual Studio Code). 

Installation of Node.js and NPM on Windows 10

  • Step-3: Click on the file menu and open the folder you just created.  

Installation of Node.js and NPM on Windows 10

  • Step-4: Once you open the folder, create a file and name it. (Here we have created a file named as welcome.js)  

Installation of Node.js and NPM on Windows 10

  • Step-5: Write your program and save it using (Ctrl + S). 
  • Step-6: Start debugging using the shortcut f5. 

Installation of Node.js and NPM on Windows 10

And that’s it! You have successfully created your first project using node.js. 

(Goodbye-COVID-19 was the message we wanted to print and it is running successfully). 

Uninstalling Node.js

Uninstalling node.js needs a manual process. Here is a step-by-step guide on how to uninstall node.js from your system.  

  • Step-1: Go to the file location where you have stored node.js

Installation of Node.js and NPM on Windows 10

  • Step-2: Select the node.js row and right-click on it. Out of the three options available, click on uninstall.  

Installation of Node.js and NPM on Windows 10

  •  Step-3: After clicking on the uninstall option, the uninstalling starts. 

Installation of Node.js and NPM on Windows 10

Once done, you will successfully uninstall node.js from your system. 

Summary 

  • In this article we have covered how to install Node.js with the help of the MSI installation module from the Node.js website. Besides, we have also learned to install the necessary modules needed to run a Node.js application. 
  • Node.js can also be installed with the help of a package manager Chocolatey. With the use of simple commands in the command prompt or in the Windows PowerShell as mentioned above, we have seen how to download node.js using the Chocolatey package manager that automatically downloads the necessary files and then installs them on the client machine. 
  • Lastly, we have learned about the uninstallation of node.js completely from your system. 

In a nutshell, we have seen how to install node.js using different methodsThat’s all you need to get started with node.js. You are free to choose any terminal of your preference. 

Keep in mind: Node.js was never made to tackle the process scaling issue but made to address the I/O scaling issue 

Red Flags: While installing node.js, make the right choice between a 32-bit installer and a 64-bit installer matching your system. For instance, if you have a 64-bit operating system  you will be unable to install the 32-version of node.js. Likewise, if you have a 32-bit operating system, you will be unable to install the 62-version of node.js. Therefore, the key here is to know your system and proceed with the next steps.  

Понравилась статья? Поделить с друзьями:
  • Как установить opengl на windows 10 intel
  • Как установить nmap на windows через командную строку
  • Как установить photoshop 2020 на windows 7
  • Как установить opengl на windows 10 64 bit
  • Как установить nissan consult 3 windows 10