How to Install npm using Mac Terminal

If you want to install npm the package manager for NodeJS you can make use of the brew package manager.

Step 1: Make sure Brew is Installed

    The first thing we do is check if HomeBrew is installed on the Mac using the command, brew --version

    Check if Brew is installed on Mac

    If you see an error - "zsh: command not found: brew" then run the below command in your Terminal to install brew first.

    /bin/bash -c "$(curl -fsSL"

Step 2: Installing npm

    Now we are good to install npm, simply run the below command in Mac Terminal.

    brew install node

    Once the installation is done, you can check if was installed correctly using the below commands.

    macOS % node -v
    macOS % npm -v

Facing issues? Have Questions? Post them here! I am happy to answer!

Author Info:

Rakesh (He/Him) has over 14+ years of experience in Web and Application development. He is the author of insightful How-To articles for Code2care.

Follow him on: X

You can also reach out to him via e-mail:

Copyright © Code2care 2024 | Privacy Policy | About Us | Contact Us | Sitemap