likes
comments
collection
share

inter芯片Mac安装NVM管理Node.js版本

作者站长头像
站长
· 阅读数 29
  1. macOS安装homebrew
# 终端输入
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
  1. 使用brew安装nvm
# 终端输入
brew install nvm
  1. 配置nvm环境变量
# 终端输入
vim ~/.zshrc
export NVM_DIR="$HOME/.nvm"
  [ -s "/usr/local/opt/nvm/nvm.sh" ] && . "/usr/local/opt/nvm/nvm.sh"  # This loads nvm
  [ -s "/usr/local/opt/nvm/etc/bash_completion.d/nvm" ] && . "/usr/local/opt/nvm/etc/bash_completion.d/nvm"  # This loads nvm bash_completion
# 终端输入
source ~/.zshrc
  1. 修改NVM权限
提示
zsh compinit: insecure directories, run compaudit for list. Ignore insecure
compaudit
sudo chown -R root:staff /usr/local/share/zsh
sudo chmod -R 755 /usr/local/share/zsh
  1. 安装指定版本Node.js

    nvm install 16.15.0