天天看點

Taro 開放式跨端跨架構 mac 上 yarn: command not found 問題解決

mac配置Taro這個時候遇到的坑、解決問題順便記錄一下。
npm i -g yarn //直接全局安裝      

然後執行

//touch的意思是沒有就建立;.bash_profile這是系統臨時的環境變量,

第一步:touch ~/.bash_profile

//打開這個檔案,如果提示沒有權限 請在前面加上 sudo

第二步:open -e ~/.bash_profile

添加如下内容

export PATH="$PATH:`yarn global bin`"

之後運作如下代碼就可以了

source ~/.bash_profile
 
yarn --version

如圖: