赞
踩
node.js 使用 nvm 进行版本管理,比较方便,记录一下使用 brew 在 macOS 上的安装步骤。
mac安装nvm需要配置环境,这就不会出现 -bash: nvm: command not found
macOS 10.15
- % sw_vers
- ProductName: Mac OS X
- ProductVersion: 10.15.6
- BuildVersion: 19G73
- % brew --version
- Homebrew 2.4.8
- Homebrew/homebrew-core (git revision 820df; last commit 2020-07-27)
- Homebrew/homebrew-cask (git revision 35ad13; last commit 2020-07-28)
使用 brew 安装比较方便,更新一下 Homebrew 并安装
- % brew update
- % brew install nvm
- ...
- ...
- ...
- You should create NVM's working directory if it doesn't exist:
-
- mkdir ~/.nvm
-
- Add the following to ~/.zshrc or your desired shell
- configuration file:
-
- 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
-
- You can set $NVM_DIR to any location, but leaving it unchanged from
- /usr/local/opt/nvm will destroy any nvm-installed Node installations
- upon upgrade/reinstall.
-
- Type `nvm help` for further information.
-
- Bash completion has been installed to:
- /usr/local/etc/bash_completion.d
- ==> Summary
- 声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/AllinToyou/article/detail/310668推荐阅读
相关标签
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。