編輯~/.bashrc文件,末尾添加 # yarn export YARN_HOME=~/.yarn export PATH=$YARN_HOME/bin:$PATH 保存,然后執(zhí)行 source ~/.bashrc