mac下host配置 + mac修改了环境变量却不生效:zsh: command not found: xxx

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

在/etc/profile中配置了go语言环境变量:spa

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

在当前的terminal执行go version是没问题的,切换到另外一个terminal窗口去执行,却发现报错:zsh: command not found: go。.net

解决方案:code

一、将配置信息配置在 ~/.zshrc文件中blog

二、添加source ~/.bash_profile到~/.zshrc文件中,这样~/.bash_profile配置的环境变量一样有效terminal

相关文章
相关标签/搜索