Install Node.js and NPM on Mac OS M1|M2 with HomeBrew

Install Node.js and NPM on Mac OS M1|M2 with HomeBrew

Mac OS has Homebrew package manager which works like a dependency manager, using it you can install Node JS and NPM in your Mac OS m1 or m2 system. 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

To install Node.js and NPM on Mac OS M1 or M2 using Homebrew, you can follow these steps:

  • Step 1: Download and Install & Update Homebrew
  • Step 2: Install Node.js
  • Step 3: Verify Node.js Installation
  • Step 4: Install npm
  • Step 5: Verify npm Installation

Step 1: Download and Install Homebrew

Homebrew is a package manager for Mac OS, which helps in installing dependencies. Using this, we can install Homebrew on Mac OS system:

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

Once installed homebrew, 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

If you have installed nodejs using brew install node command. Verify the installation of your node.js, use 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. You can now start developing and building fast and scalable applications in JavaScript with Node.js.

Recommended Tutorials

AuthorAdmin

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 *