yarn.lock file is not updating after I update the version of a dependency in package.json and run yarn install or just yarn

6.5k views Asked by At

In the repository of a project, I already have package.json and yarn.lock files. I'm updating the version of a particular package from version 2.0.14 to version 2.0.16.

When I do yarn install or just yarn, I can see the changes related to the updated package but the yarn.lock file is not updating.

Is there is any command to generate the updated yarn.lock file?

1

There are 1 answers

0
ADTC On

Try using yarn install --force as this will re-download all packages (in their locked versions unless too old) and refresh the lock file if necessary. yarn install should already do this, but in case it doesn't, you can force it to.