What is the closest to `npm ci` in yarn

shabunc picture shabunc · Oct 21, 2019 · Viewed 18.2k times · Source

In npm, there's a ci command for installing the project with a clean state. In the documentation, it is claimed that:

It can be significantly faster than a regular npm install by skipping certain user-oriented features. It is also more strict than a regular install, which can help catch errors or inconsistencies caused by the incrementally-installed local environments of most npm users.

What is the closest equivalent of the npm ci command in yarn world? Maybe the answer is that we don't need this in yarn because its architecture is such that we don't need a special mode. Maybe the answer is to use a bunch of configuration settings. However, I'm failing to find a single complete answer to this question and I believe it would be valuable to have it.

Answer

fab67 picture fab67 · Oct 23, 2019

I believe it's as simple as that:

yarn install --frozen-lockfile