2

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?

ADTC
  • 8,999
  • 5
  • 68
  • 93
  • Could you please describe what commands are you running. If there was a package update then your .lock file should be updated, it is default behaviour. – davidmpaz Sep 23 '22 at 10:49
  • I was using yarn install and also yarn as well but the lock file is not updating – Srinu Rachakonda Sep 23 '22 at 10:56
  • Something else it is happening there. Please read carefully the documentation: https://classic.yarnpkg.com/lang/en/docs/cli/install/ your are probably missing something in your scenario. – davidmpaz Sep 23 '22 at 11:03

1 Answers1

0

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.

ADTC
  • 8,999
  • 5
  • 68
  • 93