macos下每次都需要用source ~/.bash_profile才能使环境变量生效的问题

打开终端

vim ~/.zshrc    (如果没有,则touch一个)

写入如下命令:

source ~/.bash_profile

保存退出后执行如下命令

source ~/.zshrc

即可解决以上问题

你可能感兴趣的:(macos下每次都需要用source ~/.bash_profile才能使环境变量生效的问题)