Merge conflicts in lockfiles can be pretty gnarly to resolve. Here are my thoughts on how to resolve those safely (using yarn.lock
as an example).
TLDR:
Don’t resolve conflicts manually or delete the lockfile. Revert the staged changes to the lockfile and run yarn install
again.
Very long, only read if you’re interested:
Resolving merge conflicts manually (or editing a lockfile manually) can be a bad idea. Knowing which changes to accept or reject is very confusing, and manual edits can interfere with tools like yarn
or npm
’s ability to perform dependency resolution when changes were made to package.json
.