0


zsh: bad CPU type in executable: /usr/local/bin/git

MAC安装nvm的时候报错zsh: bad CPU type in executable: /usr/local/bin/git

查找原因:
通过

where git

可以看到有2个路径
一个/usr/bin/git一个/usr/bin/local/git

which git

返回/usr/bin/local/git
而 /usr/bin/local/git --version也报这个错 zsh: bad CPU type in executable
应该是由于mac自带git,而我又安装了一个git,导致产生冲突
解决方式就是卸载掉自己安装的git

sh /usr/local/git/uninstall.sh

然后就ok了
继续安装nvm

sudo curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash

然后执行nvm报错:

zsh: command not found: nvm

就把下面这段粘贴到~/.bash_profile里,文件没有就手动创建一个。

export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
标签: 前端

本文转载自: https://blog.csdn.net/qq_41028148/article/details/127029554
版权归原作者 玛已 所有, 如有侵权,请联系我们删除。

“zsh: bad CPU type in executable: /usr/local/bin/git”的评论:

还没有评论