You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If both package.json and package-lock.json have merge conflicts, the merge driver fails ungracefully. Here's what it looks like:
Details
Using index info to reconstruct a base tree...
M <redacted>/npm-shrinkwrap.json
M <redacted>/package.json
Falling back to patching base and 3-way merge...
npx: installed 52 in 1.765s
npm-merge-driver: merging <redacted>/npm-shrinkwrap.json
npm ERR! file <redacted>/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token < in JSON at position 1652 while parsing near '...helpers": "^3.2.1",
npm ERR! <<<<<<< HEAD
npm ERR! "en...'
npm ERR! File: <redacted>/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! A complete log of this run can be found in:
npm ERR! <redacted>/.npm/_logs/2017-12-19T21_20_36_300Z-debug.log
npm-merge-driver: --legacy enabled. Checking out --theirs and retrying merge.
npm-merge-driver: !!!SOME CHANGES MAY BE LOST!!!
npm ERR! file <redacted>/package.json
npm ERR! code EJSONPARSE
npm ERR! Failed to parse json
npm ERR! Unexpected token < in JSON at position 1652 while parsing near '...helpers": "^3.2.1",
npm ERR! <<<<<<< HEAD
npm ERR! "en...'
npm ERR! File: <redacted>/package.json
npm ERR! Failed to parse package.json data.
npm ERR! package.json must be actual JSON, not just JavaScript.
npm ERR!
npm ERR! Tell the package author to fix their package.json file. JSON.parse
npm ERR! A complete log of this run can be found in:
npm ERR! <redacted>/.npm/_logs/2017-12-19T21_20_38_207Z-debug.log
Command failed: npm install --package-lock-only
Auto-merging <redacted>/package.json
CONFLICT (content): Merge conflict in <redacted>/package.json
Auto-merging <redacted>/npm-shrinkwrap.json
CONFLICT (content): Merge conflict in <redacted>/npm-shrinkwrap.json
error: Failed to merge in the changes.
Patch failed at 0001 FE2: upgrade test tooling
The copy of the patch that failed is found in: .git/rebase-apply/patch
Resolve all conflicts manually, mark them as resolved with
"git add/rm <conflicted_files>", then run "git rebase --continue".
You can instead skip this commit: run "git rebase --skip".
To abort and get back to the state before "git rebase", run "git rebase --abort".
I'm not familiar with git merge drivers. I assume it's impossible to resolve the package.json conflicts automatically, but would it be possible to detect this case and display a more graceful error message explaining what happened and what I need to do next?
If both package.json and package-lock.json have merge conflicts, the merge driver fails ungracefully. Here's what it looks like:
Details
You can repro by doing something like:
I'm not familiar with git merge drivers. I assume it's impossible to resolve the package.json conflicts automatically, but would it be possible to detect this case and display a more graceful error message explaining what happened and what I need to do next?
P.S. Thank you for making this ❤️