MAC安裝nvm的時(shí)候報(bào)錯(cuò)zsh: bad CPU type in executable: /usr/local/bin/git
查找原因:
通過where git
可以看到有2個(gè)路徑
一個(gè)/usr/bin/git一個(gè)/usr/bin/local/gitwhich git
返回/usr/bin/local/git
而 /usr/bin/local/git --version也報(bào)這個(gè)錯(cuò) zsh: bad CPU type in executable
應(yīng)該是由于mac自帶git,而我又安裝了一個(gè)git,導(dǎo)致產(chǎn)生沖突
解決方式就是卸載掉自己安裝的gitsh /usr/local/git/uninstall.sh
然后就ok了
繼續(xù)安裝nvm文章來源:http://www.zghlxwxcb.cn/news/detail-505997.html
sudo curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
然后執(zhí)行nvm報(bào)錯(cuò):zsh: command not found: nvm
就把下面這段粘貼到~/.bash_profile里,文件沒有就手動(dòng)創(chuàng)建一個(gè)。文章來源地址http://www.zghlxwxcb.cn/news/detail-505997.html
export NVM_DIR="$HOME/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh"
到了這里,關(guān)于zsh: bad CPU type in executable: /usr/local/bin/git的文章就介紹完了。如果您還想了解更多內(nèi)容,請?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!