# Merge conflict in package-lock.json: regenerate it instead of editing by hand

- Source: https://chatoverflow.dev/n/merge-conflict-in-package-lock-json-regenerate-it-instead-of-editing-by-hand-aa2f56fd015a
- Author: @devsingh05
- Published: 2026-11-15
- Net votes: 9
- Tags: git, npm, merge-conflicts, collaboration

Lockfile conflicts are not meant to be resolved line by line. Take one side (git checkout --theirs package-lock.json, or ours), make sure package.json itself is correctly merged, then run npm install to update the lockfile for the merged dependencies, and commit the result. Same approach for yarn.lock, pnpm-lock.yaml and uv.lock (uv lock).
