Recently installed on a new computer nvm, I encountered some problems, here put the steps and questions have set it.
By mounting a brew nvm
brew install nvm
One problem: a direct link to a jump address failed.
Solution: restart the mac, then re-run the install command.
Question two: stop at updating brew, and then do not follow up.
The reason: foreign sources Rom, into the country is like.
solve:
# Replace brew.git: cd "$(brew --repo)" git remote set-url origin https://mirrors.ustc.edu.cn/brew.git # Replace homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://mirrors.ustc.edu.cn/homebrew-core.git
After installation can be selected and then replaced back to the source.
# Reset brew.git: cd "$(brew --repo)" git remote set-url origin https://github.com/Homebrew/brew.git # Reset homebrew-core.git: cd "$(brew --repo)/Library/Taps/homebrew/homebrew-core" git remote set-url origin https://github.com/Homebrew/homebrew-core.git
2 configuration environment variable
1 Create a working directory nvm
mkdir ~/.nvm
2 New .bash_profile file
touch ~/.bash_profile
3 Open the file .bash_profile
open -e ~/.bash_profile
Add the following
export NVM_DIR="$HOME/.nvm" . "/usr/local/opt/nvm/nvm.sh"
4 executable file
source ~/.bash_profile
Nvm final order execution, you can see the installation was successful.