美文网首页
mac环境变量失效,没有作用

mac环境变量失效,没有作用

作者: SeanLink | 来源:发表于2021-06-07 16:09 被阅读0次

每次打开终端都需要source .bash_profile才能使用自己定义的环境变量。

这个是因为新版本的macOS开始,新用户的默认shell改为了zsh

解决方法:

对于zsh,使用.zshrc,只需要把你的环境变量配置到 .zshrc里面一遍即可

```

open ~/.bash_profile

```

复制 command + c  

```

open ~/.zshrc

```

粘贴 command + v

解决

相关文章

网友评论

      本文标题:mac环境变量失效,没有作用

      本文链接:https://www.haomeiwen.com/subject/mssxeltx.html