I understand the purpose of package-lock.json
, but I'm unsure about how the caret range works after adding this file.
Let's say I have a package called my-module
and I want to automatically receive all new non-breaking versions without manually specifying them. When I install the latest version, my package.json
file shows:
"my-module": "^4.1.1"
However, every time I update my-module
, both the version in package.json
and in package-lock.json
change to reflect this fixed version.
When a new version like 4.1.2
of my-module
becomes available, running npm i
will not update it because the version is locked in the package-lock.json
.
Question
How can I ensure that npm i
always downloads the latest non-breaking version of my-module
without constantly creating a new package-lock.json
file? Does the use of a caret range invalidate its purpose?