問題原有:mac中安裝了my zsh [http://www.javashuo.com/article/p-yfmifxwy-p.html] ,可是形成了在使用vscode的時候,提示」zsh: command not found「html
緣由是兩個不一樣的終端環境變量不同。shell
解決方法:vim
把 bash shell 中.bash_profile 所有環境變量加入zsh shell裏就好bash
一、spa
cat .bash_profile # Setting PATH for Python 3.5 # The orginal version is saved in .bash_profile.pysave #PATH="/Library/Frameworks/Python.framework/Versions/3.5/bin:${PATH}" #export PATH export GOPATH=$HOME/go GOROOT=/usr/local/go export GOROOT #GOROOT bin export PATH=$PATH:$GOROOT/bin #GOPATH bin export PATH=$PATH:$GOPATH/bin export PATH="/usr/local/opt/openssl/bin:$PATH"
將上述中涉及到的go環境變量加入到zash環境變量中去。code
二、htm
vim .zshrc #在最下面加入go環境變量便可 #export PATH export GOPATH=$HOME/go GOROOT=/usr/local/go export GOROOT #GOROOT bin export PATH=$PATH:$GOROOT/bin #GOPATH bin export PATH=$PATH:$GOPATH/bin export PATH="/usr/local/opt/openssl/bin:$PATH"
三、生效配置blog
source .zshrc