What is the equivalent command for npm ci in pnpm?
According to the documentation for npm install:
pnpm installis used to install all dependencies for a project.In a CI environment, installation fails if a lockfile is present but needs an update.
How is the "CI environment" defined?
What does the following mean? Dependencies could be updated, but the
pnpm-lock.yaml is not touched?
pnpm i --frozen-lockfile# pnpm-lock.yamlis not updated
The equivalent is
However, even if you don't use
--frozen-lockfile, pnpm will automatically use a faster installation strategy if the lockfile is up-to-date. This is controlled by the prefer-frozen-lockfile setting which istrueby default.pnpm uses the is-ci package to detect whether the environment is a CI.
It means that if the lockfile is not up-to-date with the
package.jsonfile thenpnpm installwill throw an exception instead of updating the lockfile. If the lockfile is up-to-date, pnpm will do any necessary updates to thenode_modules.