Skip to content

Instantly share code, notes, and snippets.

@oldmonad
Forked from szemate/package-lock-conflicts.md
Created June 16, 2022 21:34
Show Gist options
  • Select an option

  • Save oldmonad/3542ec86cca899c68abb3e17baecf49e to your computer and use it in GitHub Desktop.

Select an option

Save oldmonad/3542ec86cca899c68abb3e17baecf49e to your computer and use it in GitHub Desktop.

Revisions

  1. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -27,7 +27,7 @@ It is not possible to resolve conflicts of package-lock.json in GitHub's merge t
    npm install
    ```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly.
    1. If the application is starting (i.e. there are no missing dependencies), add all changes and finish the merge:
    1. If the application is able to start up (i.e. there are no missing dependencies), add all changes and finish the merge:
    ```
    git add --update
    git commit
  2. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 1 addition and 4 deletions.
    5 changes: 1 addition & 4 deletions package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -26,10 +26,7 @@ It is not possible to resolve conflicts of package-lock.json in GitHub's merge t
    ```
    npm install
    ```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly:
    ```
    npm start
    ```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly.
    1. If the application is starting (i.e. there are no missing dependencies), add all changes and finish the merge:
    ```
    git add --update
  3. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 8 additions and 4 deletions.
    12 changes: 8 additions & 4 deletions package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -20,12 +20,16 @@ It is not possible to resolve conflicts of package-lock.json in GitHub's merge t
    Automatic merge failed; fix conflicts and then commit the result.
    ```
    1. Open your editor (e.g. VSCode) and:
    * Carefully resolve any conflict in `package.json`.
    * Ignore the conflicts in `package-lock.json`.
    * Carefully resolve any conflict in `package.json`
    * Ignore the conflicts in `package-lock.json`
    1. Install packages, which will re-generate `package-lock.json`:
    ```npm install```
    ```
    npm install
    ```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly:
    ```npm start```
    ```
    npm start
    ```
    1. If the application is starting (i.e. there are no missing dependencies), add all changes and finish the merge:
    ```
    git add --update
  4. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -19,7 +19,7 @@ It is not possible to resolve conflicts of package-lock.json in GitHub's merge t
    CONFLICT (content): Merge conflict in package.json
    Automatic merge failed; fix conflicts and then commit the result.
    ```
    1. Open VS code and:
    1. Open your editor (e.g. VSCode) and:
    * Carefully resolve any conflict in `package.json`.
    * Ignore the conflicts in `package-lock.json`.
    1. Install packages, which will re-generate `package-lock.json`:
  5. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,6 @@
    # How to resolve package-lock.json conflicts

    It is not possible to resolve conflicts of package-lock.json in GitHub and you need to do a manual merge.
    It is not possible to resolve conflicts of package-lock.json in GitHub's merge tool and you need to do a manual merge.

    1. Update the `main` branch with the latest changes:
    ```
  6. @szemate szemate revised this gist Mar 17, 2022. 1 changed file with 27 additions and 27 deletions.
    54 changes: 27 additions & 27 deletions package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -3,36 +3,36 @@
    It is not possible to resolve conflicts of package-lock.json in GitHub and you need to do a manual merge.

    1. Update the `main` branch with the latest changes:
    ```
    git checkout main
    git pull
    ```
    ```
    git checkout main
    git pull
    ```
    1. Merge your feature branch into `main`:
    ```
    git merge mybranch
    ```
    You will see something like the following message:
    ```
    Auto-merging package-lock.json
    CONFLICT (content): Merge conflict in package-lock.json
    Auto-merging package.json
    CONFLICT (content): Merge conflict in package.json
    Automatic merge failed; fix conflicts and then commit the result.
    ```
    ```
    git merge mybranch
    ```
    You will see something like the following message:
    ```
    Auto-merging package-lock.json
    CONFLICT (content): Merge conflict in package-lock.json
    Auto-merging package.json
    CONFLICT (content): Merge conflict in package.json
    Automatic merge failed; fix conflicts and then commit the result.
    ```
    1. Open VS code and:
    * Carefully resolve any conflict in `package.json`.
    * Ignore the conflicts in `package-lock.json`.
    * Carefully resolve any conflict in `package.json`.
    * Ignore the conflicts in `package-lock.json`.
    1. Install packages, which will re-generate `package-lock.json`:
    ```npm install```
    ```npm install```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly:
    ```npm start```
    ```npm start```
    1. If the application is starting (i.e. there are no missing dependencies), add all changes and finish the merge:
    ```
    git add --update
    git commit
    ```
    (Make sure not to commit the `*.orig` files!)
    ```
    git add --update
    git commit
    ```
    (Make sure not to commit the `*.orig` files!)
    1. If everything looks fine, push to GitHub:
    ```
    git push
    ```
    ```
    git push
    ```
  7. @szemate szemate created this gist Mar 17, 2022.
    38 changes: 38 additions & 0 deletions package-lock-conflicts.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,38 @@
    # How to resolve package-lock.json conflicts

    It is not possible to resolve conflicts of package-lock.json in GitHub and you need to do a manual merge.

    1. Update the `main` branch with the latest changes:
    ```
    git checkout main
    git pull
    ```
    1. Merge your feature branch into `main`:
    ```
    git merge mybranch
    ```
    You will see something like the following message:
    ```
    Auto-merging package-lock.json
    CONFLICT (content): Merge conflict in package-lock.json
    Auto-merging package.json
    CONFLICT (content): Merge conflict in package.json
    Automatic merge failed; fix conflicts and then commit the result.
    ```
    1. Open VS code and:
    * Carefully resolve any conflict in `package.json`.
    * Ignore the conflicts in `package-lock.json`.
    1. Install packages, which will re-generate `package-lock.json`:
    ```npm install```
    1. "Test drive" your application to make sure the conflicts in `package.json` have been resolved correctly:
    ```npm start```
    1. If the application is starting (i.e. there are no missing dependencies), add all changes and finish the merge:
    ```
    git add --update
    git commit
    ```
    (Make sure not to commit the `*.orig` files!)
    1. If everything looks fine, push to GitHub:
    ```
    git push
    ```