![]() ![]() Installing the older versions of Node. How to install NodeJS and NPM on Mac using Homebrew by Hayas Ismail Medium Write Sign up Sign In 500 Apologies, but something went wrong on our end. ![]() This installs the latest version of Node.js. Now you're ready to install node via Homebrew: run brew install node. To install Homebrew, type this command into your Terminal window: /usr/bin/ruby -e ' (curl -fsSL The command uses curl to download the Homebrew installation script from Homebrew’s Git repository on GitHub. Test if Node.js is already installed somewhere else with node -v: if it gives you a version number, uninstall it by following these instructions. We’ll use Homebrew to install the most recent version of Node.js. ![]() If not, go to the the website brew.sh and copy-paste the command given in your terminal to install it. As a safe measure you should run brew doctor to make sure your system is ready to brew. If you look above you will see that we have some issues. ![]() As well, NVM is explicitly not supported when installed via homebrew - the only correct way to install it is with the install script in NVMs Readme. node -v v7.7.2 npm -v 4.1.2 Possible issues/errors that may occur. If you install Node first and then try to install NVM, things can get complicated, so if you have already installed Node, my suggestion is to completely remove it before installing NVM. First, check if Homebrew is installed with brew -v. brew install node If everything installed successfully then you can type in the following command in the terminal to check the Node and NPM version. Note: to download the latest version of npm, on the command line, run the following command: npm install -g npm. So instead of brew install node I do arch -x8664 brew install node. We do not recommend using a Node installer, since the Node installation process installs npm in a directory with local permissions and can cause permissions errors when you run npm packages globally. Now, if I install Homebrew, I'm strongly recommended to use Rosetta, so I did. If you've not already done so, please make sure that Node.js is installed via Homebrew. I have a new Mac with an M1 chip, and want to install Node. In this tutorial I'll show you how to switch between multiple versions of Node.js on macOS with Homebrew.įirst we need to make sure that your environment is ready. But sometimes you'll need a different version of Node.js than the latest. It is also the best way to install Node.js and, with that, npm. Homebrew is an awesome tool for installing and managing packages installed on macOS. ![]()
0 Comments
Leave a Reply. |