Updating the version of package-lock.json in Javascript

To install packages without an update lock file, you can use “npm ci” if you already have it. In the second scenario, the default behavior is to read from package-lock.json. To rewrite the file, you can use “npm install”.


Solution 1:

As previously noted, even though it is not related to Laravel, you can utilize npm-check-updates to inspect for updates on your

package.json

.

It is installed like this

npm install -g npm-check-updates

And you can use it by running

ncu


Solution 2:


1

Execute the

npm outdated

command to detect any obsolete packages and view the desired version in the output.

Execute the

npm update

command to upgrade to the latest

wanted

release.


2

If the automated installation fails, attempt to install the software manually.


npm install object-path@~0.11.5

Warning: Three.

You can update all dependencies to their latest versions as well.


npx npm-check-updates -u

Updating blindly may result in compatibility issues, which could cause your project to malfunction or even fail.


Solution 3:

Try:

npm i --package-lock-only

Frequently Asked Questions