Introduction
For Windows, we will install Node.js directly from the Node.js website. Let's get started! Install Node.js. Follow this link to the download page on the Node.js website and click the Windows Installer button. This will start a download of the.msi file. When that is complete, click on the downloaded file to start the Node.js Setup Wizard.
The Mac installation was done on macOS El Captain (10.11.6). Installation on a higher version should not be any different. Install node.js for macOS or Windows. Node-RED supports node.js 0.10.x or later. It is recommended to use the LTS (long-term maintenance) version of node.js. Get and install node.js 4.x LTS that matches your platform. Short and simple way to install node.js and node-red on Mac OSX. Website links install node-red: instal.
Getting Node.js will always be the first step in getting started with building Node.js applications.
In this article, we will walk you through downloading Node.js. There are three sections: Windows, Linux, and macOS. Choose the one that matches your operating system.
Once completed, you will be ready to start building Node.js applications!
Table of Contents
Windows
For Windows, we will install Node.js directly from the Node.js website.
Let's get started!
Install Node.js
Follow this link to the download page on the Node.js website and click the Windows Installer button.
This will start a download of the .msi
file.
When that is complete, click on the downloaded file to start the Node.js Setup Wizard. You will be given a series of prompts as you work through the setup wizard.
When you are finished, open a command prompt and execute the following command:
You should see an output similar to this (you may see a different version number based on which one you installed):
NPM (Node.js Package Manager) should have been automatically bundled with your Node.js installation. But you can double-check it with this command:
You should see an output similar to this (you may see a different version number based on which one you installed):
You now have Node.js installed and it's ready for you to use!
Linux
We will be using the Node Version Manager (Nvm
). And compared to other Node.js installation methods, it has the easiest ways to have multiple versions of Node.js without adding much extra complexity. There will be times when applications need different versions of Node.js to work, so having the flexibility to change that is important and will save you a lot of time.
Before going through these steps, open a new terminal (CTRL
+ALT
+T
) and navigate to the home directory of your machine:
Install/Verify System Packages
First, let's update the system packages on your machine:
When that finishes, run the following command to install the build-essential
package if you don't already have it:
Install Nvm (Node Version Manager)
Now we are ready to install the nvm
package. Use one of the two (curl
or wget
) commands below to run the nvm
bash
script.
At the time of publication, NVM v0.34.0
was the most recent version available. Make sure you check the NVM Github project page to get the latest version and replace the yellow text in the commands below.
curl
command:
Or use the wget
command:
The bash
script clones the nvm
repository to ~/.nvm
and adds the source line to your profile (~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
).
Reload the Shell
After running the above command, you will receive an output message similar to the following in your terminal:
You can reload the shell by running:
Or simply open a new Terminal window/tab.
Verify the Installation
To verify that nvm
was installed correctly, use this command:
You should see an output with the version of nvm
you downloaded.
Now let's install the latest Node.js stable release (replace v10.16.0
with the version you wish to install):
You now have Node.js installed and it's ready for you to use!
macOS
We will be using the Node Version Manager (Nvm
). And compared to other Node.js installation methods, it has the easiest ways to have multiple versions of Node.js without adding much extra complexity. There will be times when applications need different versions of Node.js to work, so having the flexibility to change that is important and will save you a lot of time.
Before going through these steps, open a new terminal window.
To open it, either open your Applications folder, then open Utilities and double-click on Terminal, or press Command - spacebar to launch Spotlight and type 'Terminal,' then double-click the search result.
Install Nvm (Node Version Manager)
Now we are ready to install the nvm
package. Use one of the two (curl
or wget
) commands below to run the nvm
bash
script.
At the time of publication, NVM v0.34.0
was the most recent version available. Make sure you check the NVM Github project page to get the latest version and replace the version shown in the commands below.
curl
command:
Or use the wget
command:
The bash
script clones the nvm
repository to ~/.nvm
and adds the source line to your profile (~/.bash_profile
, ~/.zshrc
, ~/.profile
, or ~/.bashrc
).
Reload the Shell
After running the above command, you will receive an output message similar to the following in your terminal:
You can reload the shell by running:
Or simply open a new Terminal window/tab.
Verify the Installation
Node Install Specific Version
To verify that nvm
was installed correctly, use this command:
You should see an output with the version of nvm
you downloaded.
Now let's install the latest Node.js stable release (replace v10.16.0
with the version you wish to install):
You now have Node.js installed and you are ready to start building!
Go build something cool! Thanks for reading and happy coding.
Via Installer
Go to Download page on Node.js and click on Macintosh Installer box. This will start down downloading Node installer for mac.
The downloaded file will be named node-v<version-no.>.pkg
.
Please check out last section of tip to verify the installation
Via Homebrew
If you using Homebrew, then installing the node is breeze with just following command -
Node Js Install
brew install node
I recommend using brew
because it always keeps latest version of node available and updating same just running brew update node
.
Please check out last section of tip to verify the installation
Mac Install Npm
Go to Download page on Node.js and click on Windows Installer box. This will start down downloading Node installer for mac.
The downloaded file will be named node-v<version-no.>-<architecture-type>.msi
.
Please check out last section of tip to verify the installation
Refer to my previous tip for installation using NVM.
This will work for both Mac and Windows.
After successful download of the file, click to run the installer for same. Follow the instructions given installer to complete the installation. After installation, you will have Node and NPM installed on your machine. and node
and npm
commands will be available via command line.
Verify successful installation by checking-
Install Node For Mac
node -v
npm -v
Node Js Install For Mac
On successful installation, it will print out the respective versions for same.