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 fetchupdates these branch pointers. - Checkout your feature branch
git checkout feature-branch - Update your feature branch:
git pull origin feature-branch cd javascriptto move into the JavaScript subdirectory.- Delete the old
package-lock.jsonwithrm 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.