Search code examples
yarn-workspacesdependabotyarn-lock.jsonyarnpkg-v2

Error upgrading dependencies in yarn.lock file with yarn up in Yarn 2.0


I'm trying to use Yarn 2.0 to upgrade to the latest version of the dependency in my yarn.lock to resolve a dependabot issue. The issue exists with the ini dependency and I tried running command yarn up ini which resulted in the following error:

❯ yarn up ini
Usage Error: Pattern ini doesn't match any packages referenced by any workspace

I noticed that I can use yarn up to upgrade packages in package.json file, but haven't been able to figure out how to update a dependency in a yarn.lock. I'm wondering if anyone knows what command I should be using instead?

Any help would be greatly appreciated. Thank you!

Documentation Source: https://yarnpkg.com/getting-started/migration#renamed


Solution

  • I learned that you can't upgrade individual dependencies in the yarn-lock file, you have to upgrade package with the dependency in the package.json file by running the command:

    yarn up ${package_name} followed by yarn install in Yarn 2.0.