There is no way to do this, may be this link can explain better https://dev.to/saurabhdaware/but-what-the-hell-is-package-lock-json-b04
The story about package.json
vs package-lock.json
is tricky: npm install
does not ignore package.json
versions, nor does it ignore the package-lock.json
. What it does is verify that the package.json
and package-lock.json
correspond to each other. That is, if the semver versions described in package.json
fit with the locked versions in package-lock.json
, npm install will use the latter completely, just like npm ci would.
Now, if you change package.json
such that the versions in package-lock.json are no longer valid, your npm install will be treated as if you'd done npm install some-pkg@x.y.z
, where x.y.z
is the new version in the package.json
for some-package.