DEV Community

Deepanshu Jangra
Deepanshu Jangra

Posted on

How to Install NVM and Node on macOS M1 Silicon in 2023

As a software engineer working on a Mac with an M1 Silicon chip, having NVM (Node Version Manager) and Node.js installed is crucial. In 2023, setting up your development environment for Node.js on an M1 Mac is easier than ever. In this guide, we'll walk you through the steps to install NVM and Node.js, enabling you to streamline your development workflow.

Step 1: Get NVM

  1. Check for .zshrc Profile: Open a new terminal window and run the following command to check if you already have a .zshrc profile:
   $ ls -a
Enter fullscreen mode Exit fullscreen mode

If you see .zshrc in the list, you can skip this step. However, if it's not there, you need to create one:

   $ touch .zshrc
Enter fullscreen mode Exit fullscreen mode
  1. Install NVM: Now that you have a .zshrc profile, it's time to install NVM. Visit the official NVM GitHub repository [here] to find the NVM cURL install command. The command should look something like this:
   $ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
Enter fullscreen mode Exit fullscreen mode

Copy this command and paste it into your terminal. This will download and install NVM, making it available for use.

  1. Refresh .zshrc: As this installation affects your .zshrc profile, you should run the following command to update it:
   $ source .zshrc
Enter fullscreen mode Exit fullscreen mode

Congratulations, you now have NVM installed on your Mac!

Step 2: Get Node

  1. Install Node: To install Node.js using NVM, simply run this command in your terminal:
   $ nvm install node
Enter fullscreen mode Exit fullscreen mode

This command will download and install the latest version of Node.js.

  1. Activate Node: While Node.js is now downloaded, you need to activate it to use it. Run the following command:
   $ nvm use node
Enter fullscreen mode Exit fullscreen mode

This command sets the recently installed Node.js version as the active one.

Conclusion:
You've successfully set up NVM and installed Node.js on your macOS M1 Silicon-based machine. This streamlined process ensures you have the tools necessary for your development tasks in 2023. With NVM and Node.js at your disposal, you can easily manage Node.js versions and enjoy a smooth development experience on your M1 Mac.

By following these steps, you'll be well-prepared to tackle your software development projects on your Mac with confidence. Happy coding!

Top comments (1)

Collapse
 
mhawila profile image
mhawila • Edited

Is there a known problem with M3? coz no matter what I do no version of node is able to run on my lappy.