diff --git a/packages/nx/src/utils/lock-file/__snapshots__/lock-file.spec.ts.snap b/packages/nx/src/utils/lock-file/__snapshots__/lock-file.spec.ts.snap index 5f37b195615b2..ec39aa78bc583 100644 --- a/packages/nx/src/utils/lock-file/__snapshots__/lock-file.spec.ts.snap +++ b/packages/nx/src/utils/lock-file/__snapshots__/lock-file.spec.ts.snap @@ -958,7 +958,7 @@ Array [ exports[`lock-file mapLockFileDataToExternalNodes yarn should map successfully complex lock file 1`] = ` Object { "data": Object { - "hash": "1e61b9db38c17534ce427d40ce84f9c03b4c439253f659e9a48513a10a52b465", + "hash": "6562d56c136e9e359c74fb6843da8deb66890de8e61e49ee766ad9cee2be6878", "packageName": "nx", "version": "14.7.5", }, diff --git a/packages/nx/src/utils/lock-file/yarn.ts b/packages/nx/src/utils/lock-file/yarn.ts index f290b7e691fd6..03ad5cedf60a4 100644 --- a/packages/nx/src/utils/lock-file/yarn.ts +++ b/packages/nx/src/utils/lock-file/yarn.ts @@ -165,16 +165,9 @@ export function transitiveDependencyYarnLookup( return version; } - // const nestedVersion = Object.values(versions).find((v) => - // v.packageMeta.some(p => p.path.indexOf(`${parentPackage}/node_modules/${packageName}`) !== -1)); - - // if (nestedVersion) { - // return nestedVersion.version; - // } - - // otherwise search for the matching version - return Object.values(versions).find((v) => satisfies(v.version, version)) - ?.version; + return Object.values(versions).find((v) => + v.packageMeta.some((p) => p === `${packageName}@${version}`) + ).version; } /**