xcode的装置

我间接在利用商店装置的

装置Homebrew

ARM版Homebrew须要装置在/opt/homebrew门路下,第一个是中科大的镜像源

中科大镜像源

/bin/zsh -c "$(curl -fsSL https://gitee.com/cunkai/HomebrewCN/raw/master/Homebrew.sh)"复制代码
官网镜像源
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)"复制代码

nvm装置

github上的会报443, github 的一些域名的 DNS 解析被净化,导致DNS 解析过程无奈通过域名获得正确的IP地址。通过配置hosts也能够应用git的地址。
  1. 首先上ip查问网站,输出raw.githubusercontent.com,查问对应的ip

2. 批改hosts 在终端输出命令,vi /etc/hosts 减少185.199.110.133 raw.githubusercontent.com。点击esc按键,并输出:wq即可实现保留退出 图为批改过后的文件

gitee的装置地址
git clone https://gitee.com/mirrors/nvm.git ~/.nvm && cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`复制代码
git的装置地址
$ curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.35.3/install.sh | bash复制代码
解决commond not found:nvm
  1. 进入.nvm文件夹 cd ~/.nvm
  2. 查看有没有.bash\_profile文件,间接输出ls就能够查看以后文件夹下文件如果有的话间接关上 open .bash\_profile 进入.nvm文件夹。如果没有的话先新建 touch .bash\_profile,新建实现之后,关上.bash\_profile,粘贴进去下边这两行代码,是两行,有换行,粘贴进去间接退出就可
export NVM_DIR="$HOME/.nvm"[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm#批改为taobao镜像源export NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/nodeexport  NVM_IOJS_ORG_MIRROR=http://npm.taobao.org/mirrors/iojs复制代码
  1. 编译.bash\_profile source .bash\_profile
  2. 查看是否能够应用 nvm -v

解决每次敞开终端后,都须要从新执行source .bash\_profile能力从新应用nvm命令。起因:没有将配置增加到.zshrc文件中

  1. 到这里的时候须要看看咱们是否有.zshrc,如果有间接关上 open ~/.zshrc。而后粘贴下边这两行代码
export NVM_DIR=~/.nvm[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"复制代码
  1. 如果没有.zshrc

第一步创立zshrc touch .zshrc 第二步关上zshrc open -e .zshrc 第三部在zshrc文件里输出source ~/.bash\_profile而后保留: source ~/.bash\_profile 第四步刷新环境 source .zshrc

如果应用的是zsh终端,只须要增加source .zshrc即可。 查看应用的终端命令 echo $SHELL 零碎装置的终端 cat /etc/shells 切换终端 chsh -s /bin/bash //切换终端为bash chsh -s /bin/zsh // 切换终端为zsh

bash读取的配置文件:/.bash\_profile文件,zsh读取的配置文件:/.zshrc文件。在.zshrc文件中加上source ~/.bash\_profile,能够间接从.bash\_profile文件读取配置。

解决每次从新关上终端须要应用nvm use命令,用npm装置的vue cli才会失效。设置一个默认版本,nvm alias default xxx,xxx为版本号,nvm ls能够查问所有的node版本。以我的版本为例,如果要设置16.0.0为默认版本,则应用,nvm alias default 16.0.0命令设置。