yarn 的安装和使用

FLowUs邀请链接:https://flowus.cn/login?code=AXNU63
FlowUs邀请码:AXNU63


Yarn是Facebook最近发布的一款依赖包安装工具。
Yarn是一个新的快速安全可信赖的可以替代NPM的依赖管理工具

快速安装:

npm install -g yarn

macos上:

curl -o- -L https://yarnpkg.com/install.sh | bash

Linux上:

sudo apt-key adv --keyserver pgp.mit.edu --recv D101F7899D41F3C3 
echo "deb http://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
然后
sudo apt-get update && sudo apt-get install yarn

windows 下需要下载msi文件 ,下载地址:https://yarnpkg.com/latest.msi
关于安装,你可以去官网查看到更多资料 https://yarnpkg.com/en/docs/install

测试yarn版本:

yarn --version

配置淘宝镜像源:yarn config set registry https://registry.npm.taobao.org/

查看配置列表:yarn config list

设置全局目录:yarn config set global-folder "xxx"
修改全局安装目录的bin目录位置, bin目录需要自己创建, 而且需要把此目录加到系统环境变量

# 会自动设置成*\global\bin 
yarn config set prefix "D:\RTE\Yarn\global\"

修改 yarn 缓存目录:

yarn config set cache-folder "D:\RTE\Yarn\cache"

https://www.cnblogs.com/hellomrr/p/13237653.html

posted @ 2019-11-27 19:31  wbytts  阅读(371)  评论(0编辑  收藏  举报