安装brew
tips:
https://blog.csdn.net/muyimo/article/details/125211460
1 2
| /bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
|
通过brew安装nvm
第一步
第二步还要按照提示
1 2 3 4 5 6 7 8 9 10 11 12 13
| brew info nvm
You should create NVM's working directory if it doesn't exist:
mkdir ~/.nvm // ****1.shell命令行输入这个
Add the following to ~/.zshrc or your desired shell configuration file:
export NVM_DIR="$HOME/.nvm" [ -s "/opt/homebrew/opt/nvm/nvm.sh" ] && . "/opt/homebrew/opt/nvm/nvm.sh" # This loads nvm [ -s "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" ] && . "/opt/homebrew/opt/nvm/etc/bash_completion.d/nvm" # This loads nvm bash_completion
|
- 遇到找不到
.zshrc
这个文件?在根目录下确保这个文件是否存在
- 然后打开这个文件
- 没有权限时
- 常用命令
1 2 3 4 5 6 7 8
| nvm install 12.XX.XX
nvm ls
nvm use 12.XX.XX
|