Valid number
send-icon
By submitting this form, you agree to the processing of your personal data by Zignuts Technolab as outlined in our Privacy Policy.
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Software Development

How to install npm and node.js on windows & mac

Blog bannerBlog banner

Node.js is a popular runtime environment that lets developers build scalable network applications. npm (Node Package Manager) is bundled with Node.js and is widely used to manage project dependencies. This guide will walk you through the installation process on Windows and macOS.

What is Node.js and npm?

Before diving into the installation process, let’s quickly understand:

  • Node.js: A JavaScript runtime built on Chrome’s V8 engine, enabling JavaScript to run outside a browser.
  • npm: A package manager for Node.js, allowing developers to install and manage libraries and dependencies.

Node.js and npm Installation on Windows

Step 1: Download Node.js Installer 

  1. Visit the official Node.js website: https://nodejs.org.
  2. You’ll see two versions:
    • LTS (Long-Term Support): Recommended for most users.
    • Current: Includes the latest features (may not be stable for production).
  3. Click the LTS version for better stability.

Step 2: Install Node.js

  1. Locate the downloaded .msi file and double-click it to run.
  2. Follow the installer steps:
    • Accept the license agreement.
    • Choose the installation folder (default is recommended).
    • Ensure the option "Add to PATH" is checked during the installation process.
  3. Click Install and wait for the process to complete.

Step 3: Verify Installation

After installation:

  1. Open the Command Prompt (or PowerShell).
  2. Type the following commands to check if Node.js and npm are installed:

Code

        node -v
        npm -v       
      

If you see a version number, it means that Node.js has been installed successfully.

Step 4: Update npm (Optional)

You can update npm to the latest version by running:

Code

        npm install -g npm@latest 
      

This command updates npm globally to the latest version available.

Node.js and npm Installation on macOS

Option 1: Node.js and npm Installation on macOS Using the Installer

Step 1: Download Node.js Installer

  1. Visit the official Node.js website: https://nodejs.org.
  2. You’ll see two versions:
    • LTS (Long Term Support): Recommended for most users.
    • Current: Includes the latest features (may not be stable for production).
  3. Click the LTS version for better stability.

Step 2: Install Node.js

  1. Open the downloaded .pkg file.
  2. Follow the instructions in the installer wizard.
  3. Verify the installation by opening the Terminal and running:

Code

        node -v 
        npm -v
      

If you see a version number, it means that Node.js has been installed successfully.

Option 2:  Node.js and npm Installation on macOS Using Homebrew (Recommended)

Homebrew is a package manager for macOS that simplifies installations.

Step 1: Install Homebrew

If you don’t have Homebrew installed, run this command in the Terminal:

Code

        /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
      

Step 2: Install Node.js

  1. Run the following command to install Node.js (includes npm):

Code

        brew install node
      

       2. Verify the installation:

Code

        node -v
        npm -v
      

Step 3: Update npm (Optional)

If you want to update npm to the latest version:

Code

        npm install -g npm@latest
      
Hire Now!

Hire Nodejs Developers Today!

Ready to bring your server-side application vision to life? Start your journey with Zignuts expert Nodejs developers.

**Hire now**Hire Now**Hire Now**Hire now**Hire now

Conclusion:

Installing npm and Node.js on Windows and Mac is a crucial step for any JavaScript developer. By following the steps and tips provided, you can effortlessly set up your development environment and start building powerful JavaScript applications. Remember to stay updated with the latest versions, leverage community resources, and continuously optimize your workflow to make the most out of these essential tools.

No items found.

Say Hello

We’re just a message away from making great things happen.

Valid number
Submit
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
download ready
Thank You
Your submission has been received.
We will be in touch and contact you soon!

Our Latest Blogs

Load More

Our Latest Blogs

View All Blogs