How to Install NPM and Node.js on Mac?

In this tutorial, we will show you how to install node js and npm and verify it on Mac OS M1 or M2 using Homebrew.

How to Install Node.js and npm on Mac OS M1 or M2 using Homebrew

You can follow these steps:

Step 1: Download and Install Homebrew

Run the following command to install Homebrew on Mac OS system:

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Run brew update to make sure Homebrew is up to date:

brew update

Step 2: Install Node.js

Now, let’s install node.js on mac os m1 or m2 using brew install node command, run the command:

brew install node

This will download and install the latest version of Node.js on your macOS system.

Step 3: Verify Node.js Installation

Verify the installation of your node.js, by using the below-given command:

node -v

Step 4: Install npm

Now you can install npm with the help of brew command. Which is given below:

brew install npm

Step 5: Verify npm Installation

By running npm -v command on terminal or cmd to check npm is install or not:

npm -v

This command will show you the version of npm.

Conclusion

That’s it! You have successfully installed Node.js and npm on your macOS system.

Recommended Tutorials

AuthorDevendra Dode

Greetings, I'm Devendra Dode, a full-stack developer, entrepreneur, and the proud owner of Tutsmake.com. My passion lies in crafting informative tutorials and offering valuable tips to assist fellow developers on their coding journey. Within my content, I cover a spectrum of technologies, including PHP, Python, JavaScript, jQuery, Laravel, Livewire, CodeIgniter, Node.js, Express.js, Vue.js, Angular.js, React.js, MySQL, MongoDB, REST APIs, Windows, XAMPP, Linux, Ubuntu, Amazon AWS, Composer, SEO, WordPress, SSL, and Bootstrap. Whether you're starting out or looking for advanced examples, I provide step-by-step guides and practical demonstrations to make your learning experience seamless. Let's explore the diverse realms of coding together.

Leave a Reply

Your email address will not be published. Required fields are marked *