mac 安装yarn 提示 common not found

npm i -g yarn //直接全局安装

然后执行

第一步:touch ~/.bash_profile //touch的意思是没有就创建;.bash_profile这是系统临时的环境变量, 
第二步:open -e ~/.bash_profile //打开这个文件,如果提示没有权限 请在前面加上 sudo

添加如下内容

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

之后运行如下代码就可以了

source ~/.bash_profile
 
yarn --version

 仅作为个人记录

原文地址:https://www.cnblogs.com/wyLeoKing/p/13353065.html