Xcode installation
I installed it directly from the app store
Install Homebrew
Homebrew for ARM needs to be installed in the /opt/ Homebrew path, the first is the USTC mirror source
Ustc mirror source
/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"
Copy the code
Official image source
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"
Copy the code
NVM installation
The DNS resolution of some domain names on Github is contaminated, causing the DNS resolution process to fail to obtain the correct IP address through the domain name. You can also use git’s address by configuring hosts.
- First on IP query website, raw.githubusercontent.com, query the corresponding IP
2. Modify hosts. Run the vi /etc/hosts command on the terminal to view the modified file
Gitee installation address
git clone https://gitee.com/mirrors/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`
Copy the code
Git installation address
$curl - o - https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bashCopy the code
Solution Commond not found: NVM
- Go to the. NVM folder CD ~/.nvm
- To see if there is a. Bash_profile file, type ls directly to see the files in the current folder. If there is, go to open.bash_profile and go to the.nvm folder. If you don’t have one, create a touch.bash_profile, and when you’re done, open.bash_profile, and paste it into the next two lines of code, two lines, there’s a newline, paste it in and exit
Export NVM_DIR="$HOME/.nvm" [-s "$NVM_DIR/ NVM. Sh "] && \. "$NVM_DIR/ NVM NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node export NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojsCopy the code
- Compile. Bash_profile source. Bash_profile
- Check whether you can use NVM -v
Solution Each time after the terminal is shut down, the source. Bash_profile command needs to be re-executed to re-use the NVM command. Cause: Configuration not added to.zshrc file
- When we get here we need to see if we have.zshrc and if we do open ~/.zshrc. And then I’m going to paste these two lines down here
export NVM_DIR=~/.nvm
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"
Copy the code
- If not. ZSHRC
Create ZSHRC touch. ZSHRC step 2 Open ZSHRC open -e. ZSHRC Step 3 Enter source ~/. Source ~/.bash_profile Step 4 Refresh the environment source.zshrc
If the ZSH terminal is used, add source. ZSHRC. Run the echo $SHELL command on the terminal installed on the system cat /etc/shells Switch terminal CHSH -s /bin/bash // Switch terminal bash CHSH -s /bin/zsh // Switch terminal ZSH
Bash reads the configuration file: /.bash_profile and ZSH reads the configuration file: /.zshrc. Add source ~/. Bash_profile to the. ZSHRC file to read the configuration directly from the.
You need to run the NVM use command every time you restart the terminal. The Vue CLI installed using NPM takes effect. NVM alias default XXX, XXX is the version number, NVM ls can query all node versions. Take my version as an example. To set 16.0.0 as the default version, run the NVM alias default 16.0.0 command.