Mac环境变量设置无效

    xiaoxiao2021-12-14  24

    添加新的环境变量到~/.bash_profile文件,执行“source ~/.bash_profile“,发现无效,并且提示 zsh: command not found:xxx。出现这种情况是因为安装了zsh,其启动不会读取~/.bash_profile,所以配置到~/.bash_profile的参数也不会生效。解决方案是.zshrc中导入.bash_profile,步骤如下: (1)vim ~/.zshrc (2)添加source ~/.bash_profile到~/.zshrc (3)保存退出 (4)重新执行source ~/.zshrc,或重新启动zsh

    转载请注明原文地址: https://ju.6miu.com/read-970768.html

    最新回复(0)