mac 下 nvm 完全安装

参考 站
https://github.com/nvm-sh/nvm#installing-and-updating

Install & Update Script

To install or update nvm, you should run the install script. To do that, you may either download and run the script manually, or use the following cURL or Wget command:

curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
wget -qO- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash

发现 错:

原因:由于某些你懂的因素,导致GitHub的raw.githubusercontent.com域名解析被污染了。

解决办法:通过修改hosts解决此问题。

查询真实IP

查询真实IP

https://www.ipaddress.com/ 查询raw.githubusercontent.com的真实IP。

需要对 host 文件里的内容进行整改.

设置完,测试下有没有生效:

生效后,进行安装nvm

在.zsh 中安装成功,但执行命令不生效,

但在 终端命令行中

修改 .zshrc 文件,

=> Appending nvm source string to /Users/harry/.bash_profile

=> Appending bash_completion source string to /Users/harry/.bash_profile

=> Close and reopen your terminal to start using nvm or run the following to use it now:

export NVM_DIR=”$HOME/.nvm”

[ -s “$NVM_DIR/nvm.sh” ] && . “$NVM_DIR/nvm.sh” # This loads nvm

[ -s “$NVM_DIR/bash_completion” ] && . “$NVM_DIR/bash_completion” # This loads nvm bash_completion

按照这个提示,将 最后三行,添加到

添加后,执行 source .zshrc 文件,命令执行成功:

声明:本站部分文章内容及图片转载于互联 、内容不代表本站观点,如有内容涉及侵权,请您立即联系本站处理,非常感谢!

(0)
上一篇 2020年12月6日
下一篇 2020年12月6日

相关推荐