yarn init # 初始化一个新项目
# 添加依赖包
yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]
yarn global add [package] # 添加全局包
# 将依赖项添加到不同依赖项类别中
# 分别添加到 devDependencies、peerDependencies 和 optionalDependencies 类别中:
yarn add [package] --dev
yarn add [package] --peer
yarn add [package] --optional
# 升级依赖包
yarn upgrade [package]
yarn upgrade [package]@[version]
yarn upgrade [package]@[tag]
yarn remove [package] # 移除依赖包
yarn # 安装项目的全部依赖
yarn install # 安装项目的全部依赖