Home > Software engineering >  module version different between what's in yarn.lock and package.json
module version different between what's in yarn.lock and package.json

Time:08-14

I have the following content in yarn.lock file:

"@aws-sdk/client-dynamodb@^3.42.0":
  version "3.145.0"
  resolved "https://registry.yarnpkg.com/@aws-sdk/client-dynamodb/-/client-dynamodb-3.145.0.tgz#2a358e9cbb1176370488cc229d319934a6003d93"
  integrity sha512-dvy1kRTKVBiHPVrZU8aYFaHMjfoJCQ71FrhWfk5lHhLylSkRSuiffVx026Dh18b3Ob6L8N17HRAYzGV3ogAZfA==
  dependencies:

and the following in package.json:

      "dependencies": {
        "@aws-sdk/client-dynamodb": "^3.42.0",
}

This is after I did a yarn install. Why it's 3.145.0 in yarn.lock but it's 3.42.0 in package.json which is what I wanted.

I tried the following with no luck

  1. delete node_modules and yarn install.
  2. yarn cache clean and step 1 above.

CodePudding user response:

Why it's 3.145.0 in yarn.lock but it's 3.42.0 in package.json which is what I wanted.

The package.json has ^3.42.0, meaning any version of 3.x.y that's greater than 3.42.0, which includes 3.145.0.

If you want to lock this older version: yarn add @aws-sdk/[email protected]

  • Related