'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.

Option 2 - Not deleting package-lock.json and npm install

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