git merge --no-ff account-creation
Auto-merging package-lock.json CONFLICT (content): Merge conflict in package-lock.json Automatic merge failed; fix conflicts and then commit the result.
Any idea regarding this issue ?
package-lock. json is automatically generated for any operations where npm modifies either the node_modules tree, or package. json . It describes the exact tree that was generated, such that subsequent installs are able to generate identical trees, regardless of intermediate dependency updates.
package-lock. json is updated automatically on dependency changes. It should be committed to version control to ensure the same dependencies on install.
package-lock. json defines versions used in my project. There should be no need to remove it completely and thus upgrade all dependencies to the latest version just because I upgrade Vaadin.
As per the docs:
Resolving lockfile conflicts
Occasionally, two separate npm install will create package locks that cause merge conflicts in source control systems. As of
[email protected]
, these conflicts can be resolved by manually fixing anypackage.json
conflicts, and then runningnpm install [--package-lock-only]
again. npm will automatically resolve any conflicts for you and write a merged package lock that includes all the dependencies from both branches in a reasonable tree. If--package-lock-only
is provided, it will do this without also modifying your localnode_modules/
.To make this process seamless on git, consider installing
npm-merge-driver
, which will teach git how to do this itself without any user interaction. In short:$ npx npm-merge-driver install -g
will let you do this, and even works with pre-[email protected]
versions of npm 5, albeit a bit more noisily. Note that ifpackage.json
itself conflicts, you will have to resolve that by hand and runnpm install
manually, even with the merge driver.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With