

Now, kindly verify that NodeJS and npm were installed correctly Nvm will build Node from source, which will take a while (around 10 minutes for me).ģ. Install them and you may need to run the command again. You may be prompted to install command line developer tools if you haven’t already. The older versions of Node will still work on Mac M1, however you will need Rosetta 2 to run it properly. Thanks to the awesome developers and community maintainers of Node, you can install Node natively on ARM (Apple Silicon M1 / Mac M1) by installing the latest version 15.6.0 of Node. This will download the needed C++ compiler and other development tools. Next, if you do not already have the xcode command line tools installed you should install them.


You can install multiple nodejs versions and choose what to use.Let's get to installing Nodejs, npm and nvm right away on your Macbook with Apple Silicon M1 processor.įirst, You should go ahead and create a profile file (~/.bash_profile, ~/.zshrc, ~/.profile, or ~/.bashrc) for your shell if you do not have one already. To install the current LTS Node.js version, execute: nvm install -lts In this case, we are going to go with LTS one which is 16. There are multiple versions of node out there, in function of what your application is supporting you should install the right version, you can also install multiple versions and tell what to use. This part can be done on both Mac and Ubuntu as it’s using the NVM to install node. You just need to source it to have the changes, you can login/logout or do: source ~ /.bashrcĪt the end you can check to see the nvm version with the below command: nvm -version 2. The script will do the rest and activate everything needed on the user profile. Install NVM: sudo apt install curl curl | bash

In this part, we are going to see how we can install NVM on Ubuntu to use it for the last part Node.JS install. Homebrew can be used also on Ubuntu but it’s recommended to use the default repo. To activate the changes you either login logout or do: source ~ /.zshrcĪt the end you can check to see the nvm version with the below command: nvm -version Youtube Video With Details "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm & \. When using the zsh shell, add the following config inside ~/.zshrc: export NVM_DIR= " $HOME /.nvm" & \. Then create a directory in the user home mkdir ~ /.nvm To do this you just need to follow the below steps: brew install nvm bin/bash -c "$(curl -fsSL )" Install NVM with Homebrew on Mac If you are already using it you should skip this step. Homebrew is the package manager that will going to be used to install node. NVM Installation 1.1 Mac NVM Installation Install Homebrew Node.js can be installed in different ways, in this article we are going to leave NVM and see how it can be installed on our Mac or ubuntu machines.
