1、安装
brew install yarn
* 如果你使用nvm来管理node版本的话,执行以下操作
brew install yarn --without-node
# 或者
brew install yarn --ignore-dependencies
2、创建新项目
yarn init
3、添加依赖
yarn add [package]
yarn add [package]@[version]
yarn add[package]@[tag]
4、不同环境添加依赖
yarn add [package] --dev
yarn add [package] --peer
yarn add[package]--optional
5、升级依赖项
yarn upgrade [package]
yarn upgrade [package]@[version]
yarn upgrade [package]@[tag]
6、删除依赖项
yarn remove[package]
7、安装依赖包
yarn install
# 或者
yarn
网友评论