正在安裝相依性

If you have just checked out a package from version control, you will need to install those dependencies.

If you are adding dependencies for your project, then those dependencies are automatically installed during that process.

安裝相依性

yarn install is used to install all dependencies for a project. Yarn會從package.json中讀取相依套件,並將相依訊息儲存到yarn.lock中。

如果你正在開發一個套件,通常你會在以下情况之後進行相依套件的安装:

  1. You have just checked out code for a project that needs these dependencies to function.
  2. Another developer on the project has added a new dependency that you need to pick up.

安裝選項

安裝相依性有許多選項,包括:

  1. Installing all dependencies: yarn or yarn install
  2. Installing one and only one version of a package: yarn install --flat
  3. Forcing a re-download of all packages: yarn install --force
  4. Installing only production dependencies: yarn install --production

See the full list of flags you can pass to yarn install.