用途

現在,您的 Yarn 已經安裝完成,您可以開始使用 Yarn。下面是一些最常用的命令。

開始一個新專案

yarn init

新增相依套件

yarn add [package]
yarn add [package]@[version]
yarn add [package]@[tag]

Adding a dependency to different categories of dependencies

Add to devDependencies, peerDependencies, and optionalDependencies respectively:

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