When you get a merge conflict in package-lock.json
, the best way to resolve it is to simply regenerate the package-lock.json
.
Steps:
- Do a
git fetch
. Here’s what this done: your local repo has cached values for the branch pointers on the remotes (e.g.origin
, which is typically the repo on GitHub).git fetch
updates these branch pointers. - Checkout your feature branch
git checkout feature-branch
- Update your feature branch:
git pull origin feature-branch
cd javascript
to move into the JavaScript subdirectory.- Delete the old
package-lock.json
withrm package-lock.json
- Regenerate it with
npm install
- Add it to a new commit with
git add package-lock.json
- Commit:
git commit -m "your-initials update package-lock.json"
- Push:
git push origin feature-branch
This should resolve the merge conflict. If it doesn’t, you can ask the course staff for help.