mac下host配置 + mac修改了環境變量卻不生效:zsh: command not found: xxx


https://blog.csdn.net/hlllmr1314/article/details/52228672

在/etc/profile中配置了go語言環境變量:

1 export GOROOT=/usr/local/go
2 export PATH=$PATH:$GOROOT/bin

在當前的terminal執行go version是沒問題的,切換到另一個terminal窗口去執行,卻發現報錯:zsh: command not found: go。

解決方案:

1、將配置信息配置在 ~/.zshrc文件中

2、添加source ~/.bash_profile到~/.zshrc文件中,這樣~/.bash_profile配置的環境變量同樣有效

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM