參考https://blog.csdn.net/weixin_45124488/article/details/106122390
問題:
在安裝flutter環(huán)境變量之后,運(yùn)行source $HOME/.bash_profile,刷新當(dāng)前終端環(huán)境送矩。
注意: 如果你使用的是zsh尔店,終端啟動時 ~/.bash_profile 將不會被加載侠草,解決辦法就是修改 ~/.zshrc ,在其中添加:source ~/.bash_profile
實際操作方法:
//切換到 ~ 目錄下
cd ~
//編輯.zshrc文件养距,如果沒有則自動創(chuàng)建
vi .zshrc
//按i進(jìn)入編輯模式,在最后一行加入如下代碼
source ~/.bash_profile
image.png
//然后按ESC,輸入 :wq保存退出先较。
//重啟終端携冤、運(yùn)行flutter doctor,已經(jīng)生效