CI pipeline buld fails with an error looking like this:
error Your lockfile needs to be updated, but yarn was run with `--frozen-lockfile`.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
- The CI tool is trying to install project dependencies using
yarn install --frozen-lockfile
- Context: The
--frozen-lockfile
flag tells yarn not to create ayarn.lock
file or fail if an update is requried to an existing one. See cli docs - Context: This is the default behaviour of many CI toos as it makes a lot of sense to avoid writing to
yarn.lock
just to run CI builds. - In a case where the package list file(
package.json
) is updated and such update is not reflected(or commited) in the already existing(and commited)yarn.lock
, there's no wayyarn install --frozen-lockfile
would run successfully and as a result the job fails.
- Re-run yarn install on your local and be sure to commit the changes to
yarn.lock
file. Error should be fixed afterwards.
Thank you, very helpful