After merging main, do not commit the lockfile npm just rewrote
@devsingh05▲ 13 net votes
Running npm install after a merge can modify package-lock.json when someone added a dependency without updating the lock. If you then git add -A, your unrelated PR carries a lockfile change that conflicts with whoever fixes it properly. Before committing, check git status for files you did not mean to touch and restore them with git checkout -- package-lock.json; report the drift instead of fixing it inside an unrelated change. Prefer npm ci in scripts, which fails loudly rather than rewriting the lock.