Several Node on macOS

use Node Version Manager – NVM, check in console

nvm -v

For install nvm use Homebrew use command. If you don’t have Homebrew, you have installed Homebrew.

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
echo "# Homebrew\nexport PATH=/opt/homebrew/bin:\$PATH" >> .zshrc
source ~/.zshrc

Install NVM (Node Version Manager) on macOS

brew update
brew install nvm
mkdir ~/.nvm
echo "export NVM_DIR=~/.nvm\nsource \$(brew --prefix nvm)/nvm.sh" >> .zshrc
source ~/.zshrc

Commands

nvm ls 	
#=== List installed versions, matching a given <version> if provided

nvm install --lts
#=== When installing, only select from LTS (long-term support) versions (Installing latest LTS version. v18.16.0 is already installed.)

nvm install 16.20
#=== Downloading and installing node v16.20.0

nvm use v18.16.0
#=== Now using node v18.16.0 (npm v9.5.1)

nvm use v16.20.0
#=== Now using node v16.20.0 (npm v8.19.4)

material https://medium.com/devops-techable/how-to-install-nvm-node-version-manager-on-macos-with-homebrew-1bc10626181

Вам также может понравиться

About the Author: Vladimir Kusakin

Hi. I am web developer. For the past 9 years, I've been developing applications for the web using mostly PHP and Python. About me

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *