'What is the difference between deleting package-lock.json + npm install and npm install?
I'm upgrading dependencies and was wondering why these two workflows don't lead to the same result.
Option 1 - Delete package-lock.json and npm install.
- Completely upgrades/changes majority of the package-lock.json in addition to the dependencies I upgraded in the package.json
- Source: https://poanchen.github.io/blog/2020/04/13/how-to-update-package-lock-json-file-in-order-to-honour-the-and-~-symbol
Option 2 - Not deleting package-lock.json and npm install
Upgrades the dependencies in package-lock.json that I changed in the package.json.
Source: https://betterprogramming.pub/how-to-upgrade-dependencies-in-package-json-e5546804187f
I've searched stackoverflow and no one seems to be asking this. Can someone please explain the difference between the two and possibly recommend the ideal workflow for upgrading a few dependencies?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
