Read More
🎉Celebrating 25 Years of Tech Excellence and Trust - Learn More
Quick Overview: In this quick guide, we will walk you through the steps to install Node.js and NPM (Node Package Manager) on both Windows and Mac operating systems. Node.js is a powerful JavaScript runtime that allows you to build scalable and efficient web applications, while NPM is the default package manager for Node.js, providing access to a vast ecosystem of libraries and tools. Let's get started with the installation process.
JavaScript has become a go-to language in the software development industry. The front-end developers aim to create feature-rich UI with JavaScript development and engage with back-end web services using AJAX. Since JavaScript offers non-blocking nature, web developers who work on the server-side have shifted their paradigm to JavaScript.
Nowadays, many front-end frameworks like Next.js, Vue.js, React, and Angular use JavaScript as their primary language. Thanks to its code optimization functionality. In fact, choosing JavaScript development services as your first option will surely bring plenty of opportunities to master a single language while still developing “full-stack” web applications. And the vital key to this server-side JavaScript revolution is NodeJs.
Now, let’s understand what Node.js is.
NodeJS is a cross-platform environment that runs and executes JavaScript codes outside the browser. It’s a version of Chrome’s V8 JavaScript runtime engine, allowing you to develop server-side JavaScript applications. It comes up with everything which is required to run a program written in JavaScript.
Additionally, enterprises prefer Node.js over other backend technologies for its access to over 2 million NPM packages that makes development efficient, scalable, faster, and cost-effective. In fact, the top global brands from the Fortune 500 list have leveraged Node.js for enterprise applications and benefitted with top-notch level ‘speed’ and ‘scalability’.
To leverage the JavaScript powered NodeJS for product development with real-time features and heavy I/O processes, it is first important to know the method of using the NPM packages. This guide elaborates the best practices to install NodeJS and NPM in your system with detailed steps.
So, let’s get into the Node.js development guide of installation.
The NPM (Node Package Manager) is the default package manager for Node.js that helps developers to install, manage and share JavaScript modules easily.
NPM allows open-source web developers to share and borrow packages for app development. Also, it works as a command-line utility for the application for installing packages in the project, dependency management, and even version management.
1. Website: You can find packages from the official NPM website for your project. Also, you can create and set up profiles to manage and access all types of packages.
2. Command Line Interface (CLI): To interface with NPM packages and repositories, the CLI runs from your computer's terminal.
3. Registry: It has a huge database of JavaScript projects and meta-data. Thus, it allows you to use any supported NPM registry. Also, you can utilize someone else’s registry as per their terms of use.
Node.js is an open-source, cross-platform JavaScript library and runtime environment that allows you to run web applications outside the browser. Ryan Dahl developed Node.js in 2009, and the latest version, v23 (released in October 2024), while Node.js 22 is the long-term support (LTS) version, supported until April 2027. This IDE is used to develop server-side web apps, and since it uses an asynchronous, event-driven model, it is the best option for creating data-intensive apps.
Moreover, with the prior success of Node.js 22, Node.js released its latest version – Node.js 23 which includes enhanced performance, security fixes and updated features. We can say that the release line, which means NodeJS 22 is promoted to long-term support (LTS) and will receive support until April 2027.
According to the Stack Overflow Developer Survey 2024. NodeJS is the most popular web development technology. Moreover, Node.js has become the most widely used tool for web development in the US with more than 6.3 million websites.
Since Node.js architecture supports "Single Threaded Event Loop", NodeJS manages multiple concurrent clients at the same time. The Node.js processing model is built on the JavaScript event-based model, as well as the JavaScript callback mechanism.
Here’s what you need to go ahead with NodeJs and NPM.
Hardware Requirements
Software Requirements
Now, it’s time to understand each step in installing Node.js and NP on Windows and macOS.
Since we have decided to create an application using Node.Js, first of all, you have to install Node.Js on your Windows system.
Here, we are going to explain the installation process step-by-step.
Download the Installer
Install Node.js and NPM
Check Node.js and NPM Version
Download the Windows Installer from NodeJs official website. Make sure you have downloaded the latest version of NodeJs. It includes the NPM package manager.
Here, we are choosing the 64-bit version of the Node.js installer.
The LTS (Long-term Support) version is highly recommended for you. After the download of the installer package, install it with a double-click on it.
Now .msi file will be downloaded to your browser. Choose the desired location for that.
After choosing the path, double-click to install .msi binary files to initiate the installation process. Then give access to run the application.
You will get a welcome message on your screen and click the “Next” button. The installation process will start.
You should have at least 150MB of free space to install Node.js and npm features.
The following features will be installed by default:
Command Prompt window will appear on the screen.
To confirm Node installation, type node -v
command.
To confirm NPM installation, type npm -v
command.
And you don’t need to worry if you see different numbers than mine as Node and NPM are updated frequently.
In my case, the version of node.js is v23.6.0 and npm is v11.0.0.
Now, if you are using a macOS, let’s understand the process of Node.js and NPM installation.
Well, it’s a similar process as Windows. Here, Node provides a .pkg installer for Mac. Besides, we can also download from its official website
Click on the “ macOS Installer ” option to download the .pkg installer. Make sure you download it to your desired location.
Now, your installer is ready to run. However, it will not take your much time. So, let’s explain in detail here.
Introduction > Continue License > Select Continue > Agree Installation Type > Install > Authenticate with your Mac to allow the Installation > Install Software Summary > Close
To verify whether you have properly installed Node.js in your macOS, run the following command in your terminal:
node -v node -v // The command we ran - tests the version of Node.js that's currently installed v23.6.0 // The version of Node.js that's installed. It can be some other version.
Node.js doesn’t automatically update the version of npm.
Write a given command and your npm version will be updated.
$ sudo npm install npm --global // Update the
npm CLI client
Tadda! Node.js is there on your Mac system. Interesting, right? Let’s explore it further.
Now, run the given command in your terminal for Mac or Linux systems. This ensures that the NODE path is set in the PATH variable.
export PATH=/usr/local/git/bin:/usr/local/bin:$PATH
Here, /usr/local/bin
is the default path where Node will be installed.
Actually, it’s advisable to write this command in .bash_profile or .zshrc. However, it depends on which shell you are using so that these path export stay on your system and nobody can recognize them from all the terminal instances.
Let’s run the given command to add the details in .bash_profile file permanently.
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash\_profile
Run the given command to make it available to all users on the system.
source ~/.bashrc
Homebrew is an open-source and free software package management system, simplifying the installation process on macOS and Linux. It installs packages to their directory and their files into /usr/local .
Here, we can use Homebrew to install Node.js. After this installation, let’s move to the next step.
You can install Homebrew by typing brew –version into the terminal. Then, you have to type brew install node into the terminal to install npm.
It’s very easy to install Node.js and NPM using Homebrew. It lets you download, unpack and install Node and NPM on your device.
Run the given command in your terminal.
brew install node
Some files will be downloaded. So, let’s install them.
Same as the windows system, you just have to type the below-given command and run it in your terminal.
For Node: node -v
For NPM: npm -v
Homebrew will update the version of Node and NPM you have installed. Make sure that your Homebrew has the latest version of the Node package.
If not, then run the given command to update the Homebrew.
brew update
Run given the command to update version of node:
brew upgrade node
It will update Node and NPM to the latest version.
Being a professional NodeJs developer, I have got many requests asking to install multiple versions of Node.js on their devices. Yes, it is possible with NVM – Node Version Manager.
Let’s follow the given steps and install Node.
Now, you have two options to install NVM.
With cURL:
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.40.2/install.sh | bash // Installation using cURL
With wget:
wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.40.2/install.sh | bash // Installation using Wget
Now NVM will be downloaded and installed.
You can verify NVM with the given command:
nvm --version
The command will show something like (not necessarily exact):
0.40.2 # The current version of nvm - yours may differ!
Actually, it’s advisable to write this command in .bash_profile or .zshrc. However, it depends on which shell you are using so that these path export stay on your system and nobody can recognize them from all the terminal instances.
Let’s run the given command to add the details in the .bash_profile file permanently.
echo 'export PATH=/usr/local/bin:$PATH' >>~/.bash\_profile
Run the given command to make it available to all users on the system.
source ~/.bashrc
Run the given command to install the latest version of Node.js.
nvm install node
Moreover, you can select all the available Node versions if you want to install a specific version.
Let’s run the given command:
nvm ls-remote // This will list down all the available Node version
nvm install v23.6.0 // This will install Node 23.6.0
Now, let’s check the installation of different Node framework versions and which specific versions are used with the given command.
nvm ls // This will list all the Node versions installed on your machine.
nvm use v23.6.0 // This will set the Node version to 23.6.0
Also, verify the existing version with the given command:
node --version
It will show "23.6.0", as it is used in the above commands.
Done!
Now you are all set with your Node installation and can further develop the Node application.
If you are using Windows or OS X, you can use one of the installers from the Node.js official website. Make sure to install the version labeled LTS. You will find other versions as well, which have not yet been tested with npm.
Want to install latest NodeJS version for your business need?
Hire NodeJS Experts
ConclusionLet me tell you that there are various ways to install Node.js frameworks and NPM in your given system. Here, we have given you the easiest way for the installation on your Windows and macOS. That’s all you need to get started with Node.js. However, you are free to choose a system of your preference.So, if you have any doubt and are looking to develop a NodeJs application for your specific operating system, contact the prominent Node.Js development company – Radixweb. Our experts will be happy to assist you.
Faisaluddin is a dynamic Project Orchestrator passionate about driving successful software development projects. His enriched 11 years of experience and extensive knowledge spans NodeJS, ReactJS, PHP & frameworks, PgSQL, Docker, version control, and testing/debugging. Faisaluddin's exceptional leadership skills and technical expertise make him a valuable asset in managing complex projects and delivering exceptional results.
Ready to brush up on something new? We've got more to read right this way.