diff --git a/workspaces/arborist/lib/arborist/build-ideal-tree.js b/workspaces/arborist/lib/arborist/build-ideal-tree.js index 1edd0b643b60d..c0f31008d6496 100644 --- a/workspaces/arborist/lib/arborist/build-ideal-tree.js +++ b/workspaces/arborist/lib/arborist/build-ideal-tree.js @@ -1306,6 +1306,12 @@ This is a one-time fix-up, please be patient... .sort(({ name: a }, { name: b }) => localeCompare(a, b)) for (const edge of peerEdges) { + // node.parent gets mutated during loop execution due to recursive #nodeFromEdge calls. + // When a compatible peer is found (e.g. a@1.1.0 replaces a@1.2.0), the original node loses its parent. + // if node is detached/removed from the tree, or has no parent, so no need to check remaining edgesOut for that node. + if (!node.parent) { + break + } // already placed this one, and we're happy with it. if (edge.valid && edge.to) { continue diff --git a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs index 855539521b9df..f76c505e89ff2 100644 --- a/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs +++ b/workspaces/arborist/tap-snapshots/test/arborist/build-ideal-tree.js.test.cjs @@ -74672,6 +74672,315 @@ exports[`test/arborist/build-ideal-tree.js TAP more peer dep conflicts metadeps Array [] ` +exports[`test/arborist/build-ideal-tree.js TAP more peer dep conflicts peerDep replacement of top level dep with different version resulting detached top level dep > default result 1`] = ` +ArboristNode { + "children": Map { + "@test/a" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/a", + "spec": "^1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/b", + "name": "@test/a", + "spec": "1.1.0", + "type": "peer", + }, + }, + "edgesOut": Map { + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "peerOptional", + }, + "@test/c" => EdgeOut { + "name": "@test/c", + "spec": "1.1.0", + "to": null, + "type": "peerOptional", + }, + "lodash" => EdgeOut { + "name": "lodash", + "spec": "^4.17.0", + "to": null, + "type": "peerOptional", + }, + "uniq" => EdgeOut { + "name": "uniq", + "spec": "^1.0.0", + "to": null, + "type": "peerOptional", + }, + }, + "location": "node_modules/@test/a", + "name": "@test/a", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/a", + "resolved": "http://localhost:4873/@test/a/-/a-1.1.0.tgz", + "version": "1.1.0", + }, + "@test/b" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/b", + "spec": "1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/a", + "name": "@test/b", + "spec": "1.1.0", + "type": "peerOptional", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "1.1.0", + "to": "node_modules/@test/a", + "type": "peer", + }, + }, + "location": "node_modules/@test/b", + "name": "@test/b", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/b", + "resolved": "http://localhost:4873/@test/b/-/b-1.1.0.tgz", + "version": "1.1.0", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "^1.1.0", + "to": "node_modules/@test/a", + "type": "dev", + }, + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "dev", + }, + }, + "isProjectRoot": true, + "location": "", + "name": "tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", +} +` + +exports[`test/arborist/build-ideal-tree.js TAP more peer dep conflicts peerDep replacement of top level dep with different version resulting detached top level dep > force result 1`] = ` +ArboristNode { + "children": Map { + "@test/a" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/a", + "spec": "^1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/b", + "name": "@test/a", + "spec": "1.1.0", + "type": "peer", + }, + }, + "edgesOut": Map { + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "peerOptional", + }, + "@test/c" => EdgeOut { + "name": "@test/c", + "spec": "1.1.0", + "to": null, + "type": "peerOptional", + }, + "lodash" => EdgeOut { + "name": "lodash", + "spec": "^4.17.0", + "to": null, + "type": "peerOptional", + }, + "uniq" => EdgeOut { + "name": "uniq", + "spec": "^1.0.0", + "to": null, + "type": "peerOptional", + }, + }, + "location": "node_modules/@test/a", + "name": "@test/a", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/a", + "resolved": "http://localhost:4873/@test/a/-/a-1.1.0.tgz", + "version": "1.1.0", + }, + "@test/b" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/b", + "spec": "1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/a", + "name": "@test/b", + "spec": "1.1.0", + "type": "peerOptional", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "1.1.0", + "to": "node_modules/@test/a", + "type": "peer", + }, + }, + "location": "node_modules/@test/b", + "name": "@test/b", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/b", + "resolved": "http://localhost:4873/@test/b/-/b-1.1.0.tgz", + "version": "1.1.0", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "^1.1.0", + "to": "node_modules/@test/a", + "type": "dev", + }, + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "dev", + }, + }, + "isProjectRoot": true, + "location": "", + "name": "tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", +} +` + +exports[`test/arborist/build-ideal-tree.js TAP more peer dep conflicts peerDep replacement of top level dep with different version resulting detached top level dep > strict result 1`] = ` +ArboristNode { + "children": Map { + "@test/a" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/a", + "spec": "^1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/b", + "name": "@test/a", + "spec": "1.1.0", + "type": "peer", + }, + }, + "edgesOut": Map { + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "peerOptional", + }, + "@test/c" => EdgeOut { + "name": "@test/c", + "spec": "1.1.0", + "to": null, + "type": "peerOptional", + }, + "lodash" => EdgeOut { + "name": "lodash", + "spec": "^4.17.0", + "to": null, + "type": "peerOptional", + }, + "uniq" => EdgeOut { + "name": "uniq", + "spec": "^1.0.0", + "to": null, + "type": "peerOptional", + }, + }, + "location": "node_modules/@test/a", + "name": "@test/a", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/a", + "resolved": "http://localhost:4873/@test/a/-/a-1.1.0.tgz", + "version": "1.1.0", + }, + "@test/b" => ArboristNode { + "dev": true, + "edgesIn": Set { + EdgeIn { + "from": "", + "name": "@test/b", + "spec": "1.1.0", + "type": "dev", + }, + EdgeIn { + "from": "node_modules/@test/a", + "name": "@test/b", + "spec": "1.1.0", + "type": "peerOptional", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "1.1.0", + "to": "node_modules/@test/a", + "type": "peer", + }, + }, + "location": "node_modules/@test/b", + "name": "@test/b", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep/node_modules/@test/b", + "resolved": "http://localhost:4873/@test/b/-/b-1.1.0.tgz", + "version": "1.1.0", + }, + }, + "edgesOut": Map { + "@test/a" => EdgeOut { + "name": "@test/a", + "spec": "^1.1.0", + "to": "node_modules/@test/a", + "type": "dev", + }, + "@test/b" => EdgeOut { + "name": "@test/b", + "spec": "1.1.0", + "to": "node_modules/@test/b", + "type": "dev", + }, + }, + "isProjectRoot": true, + "location": "", + "name": "tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", + "path": "{CWD}/test/arborist/tap-testdir-build-ideal-tree-more-peer-dep-conflicts-peerDep-replacement-of-top-level-dep-with-different-version-resulting-detached-top-level-dep", +} +` + exports[`test/arborist/build-ideal-tree.js TAP more peer dep conflicts prod dep directly on conflicted peer, full peer set, newer > force result 1`] = ` ArboristNode { "children": Map { diff --git a/workspaces/arborist/test/arborist/build-ideal-tree.js b/workspaces/arborist/test/arborist/build-ideal-tree.js index 32bc6b25ed39c..24961be79ac32 100644 --- a/workspaces/arborist/test/arborist/build-ideal-tree.js +++ b/workspaces/arborist/test/arborist/build-ideal-tree.js @@ -1655,6 +1655,16 @@ t.test('more peer dep conflicts', async t => { error: false, resolvable: true, }, + 'peerDep replacement of top level dep with different version resulting detached top level dep': { + pkg: { + description: 'a@ -> (PeerOptional(b, c, dep, dep)) b -> ( Peer(a) ) c -> ( Peer(a) )', + devDependencies: { + '@test/a': '^1.1.0', + '@test/b': '1.1.0', + }, + }, + error: false, + resolvable: true }, }) createRegistry(t, true) diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/a.json b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a.json new file mode 100644 index 0000000000000..94cd8577573fb --- /dev/null +++ b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a.json @@ -0,0 +1,146 @@ +{ + "name": "@test/a", + "versions": { + "1.2.0": { + "name": "@test/a", + "version": "1.2.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "lodash": "^4.17.21", + "underscore": "^1.13.1", + "@test/b": "1.2.0", + "@test/c": "1.2.0" + }, + "peerDependenciesMeta": { + "@test/b": { + "optional": true + }, + "@test/c": { + "optional": true + }, + "lodash": { + "optional": true + }, + "underscore": { + "optional": true + } + }, + "_id": "@test/a@1.2.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-k7WYu8tdQY1aq8QV+7YEGcoSYXrdCACqnabuvNC8Tpwvpk/MF25CeX4nei6eliVaHqHxzNzAr60ne2TgsEoz2Q==", + "shasum": "b609076c847a018b144ab68c953817847195535a", + "tarball": "http://localhost:4873/@test/a/-/a-1.2.0.tgz" + }, + "contributors": [] + }, + "1.1.0": { + "name": "@test/a", + "version": "1.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "lodash": "^4.17.0", + "uniq": "^1.0.0", + "@test/b": "1.1.0", + "@test/c": "1.1.0" + }, + "peerDependenciesMeta": { + "@test/b": { + "optional": true + }, + "@test/c": { + "optional": true + }, + "lodash": { + "optional": true + }, + "uniq": { + "optional": true + } + }, + "_id": "@test/a@1.1.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-qlfAcmAKeohHKBVVAnwsiDs+URz5jCPYlXe+srdxX6Nzhl9W6FX9kV5Lm6XahBhB+H/c+eRi+ghAE8YcdzmFIA==", + "shasum": "0d9b53f67e05d388195ad096f61fe2c1c6f0ff8d", + "tarball": "http://localhost:4873/@test/a/-/a-1.1.0.tgz" + }, + "contributors": [] + }, + "1.0.0": { + "name": "@test/a", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "lodash": "^4.17.0", + "uniq": "^1.0.0", + "@test/b": "1.0.0", + "@test/c": "1.0.0" + }, + "peerDependenciesMeta": { + "@test/b": { + "optional": true + }, + "@test/c": { + "optional": true + }, + "lodash": { + "optional": true + }, + "uniq": { + "optional": true + } + }, + "_id": "@test/a@1.0.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-BRD01XQTy4WW2PrMdV0ZvHdqlY6v0FY3kyvEIv4v0n7apOHQwuQqjdL4iWnApfEwD0o0mVSbQs5s6DibNmDnMg==", + "shasum": "a1ec39760cf04261fff44b23582f1bafba0b14ff", + "tarball": "http://localhost:4873/@test/a/-/a-1.0.0.tgz" + }, + "contributors": [] + } + }, + "time": { + "modified": "2025-07-31T16:24:31.780Z", + "created": "2025-07-29T12:59:32.758Z", + "1.2.0": "2025-07-29T13:15:20.477Z", + "1.1.0": "2025-07-31T16:24:09.634Z", + "1.0.0": "2025-07-31T16:24:31.780Z" + }, + "users": {}, + "dist-tags": { + "latest": "1.0.0" + }, + "_rev": "44-1c1667b80cb416cc", + "_id": "@test/a", + "readme": "ERROR: No README data found!", + "_attachments": {} +} \ No newline at end of file diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.0.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.0.0.tgz new file mode 100644 index 0000000000000..00df7811e9df7 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.0.0.tgz differ diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.1.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.1.0.tgz new file mode 100644 index 0000000000000..c1a2ba7b9b186 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/a/a-1.1.0.tgz differ diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/b.json b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b.json new file mode 100644 index 0000000000000..b32a350389ca7 --- /dev/null +++ b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b.json @@ -0,0 +1,95 @@ +{ + "name": "@test/b", + "versions": { + "1.0.0": { + "name": "@test/b", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.0.0" + }, + "_id": "@test/b@1.0.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-q2p6qVG/lIpauYmngTeuWBAhqMYOR/dAzIk/nhpIuuqueji1cuhXFkuxykRn1N/imlLKWEzXxdS72krNMAohYg==", + "shasum": "049ecb3edfce0c78d1e94718bda1e2c24d004f5c", + "tarball": "http://localhost:4873/@test/b/-/b-1.0.0.tgz" + }, + "contributors": [] + }, + "1.1.0": { + "name": "@test/b", + "version": "1.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.1.0" + }, + "_id": "@test/b@1.1.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-WrPD0/5vcNlm12B6XDjTiIBN0U5SfGAuPBYJi3QeV2jEaBAnXnjWnffv7Dov0KPON3zsPg11t/EB4BDVgWIJEg==", + "shasum": "33107fbfdc56efed9ae21749aae5ea84bc4a5b80", + "tarball": "http://localhost:4873/@test/b/-/b-1.1.0.tgz" + }, + "contributors": [] + }, + "1.2.0": { + "name": "@test/b", + "version": "1.2.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.2.0" + }, + "_id": "@test/b@1.2.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-X90tU1P+EZ/IyiG4ICrQgKEBcQBQugZ/0OKo9xGN8a2dWPoJ7zefIQwpoQTy2NE5w7SgGyi6v9PQSw191v524Q==", + "shasum": "b735bde9da04cbd5f1cbb31817bf64302f0db265", + "tarball": "http://localhost:4873/@test/b/-/b-1.2.0.tgz" + }, + "contributors": [] + } + }, + "time": { + "modified": "2025-07-29T13:02:09.586Z", + "created": "2025-07-29T13:01:53.128Z", + "1.0.0": "2025-07-29T13:01:53.128Z", + "1.1.0": "2025-07-29T13:02:01.228Z", + "1.2.0": "2025-07-29T13:02:09.586Z" + }, + "users": {}, + "dist-tags": { + "latest": "1.2.0" + }, + "_rev": "9-e8970996bfeb2c4f", + "_id": "@test/b", + "readme": "ERROR: No README data found!", + "_attachments": {} +} \ No newline at end of file diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.0.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.0.0.tgz new file mode 100644 index 0000000000000..0a10edf65b2e3 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.0.0.tgz differ diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.1.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.1.0.tgz new file mode 100644 index 0000000000000..96f29aea98300 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/b/b-1.1.0.tgz differ diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/c.json b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c.json new file mode 100644 index 0000000000000..e26765f61e416 --- /dev/null +++ b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c.json @@ -0,0 +1,95 @@ +{ + "name": "@test/c", + "versions": { + "1.0.0": { + "name": "@test/c", + "version": "1.0.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.0.0" + }, + "_id": "@test/c@1.0.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-ikGDvMXxzqHgCkIycVNWmpfDs6G/aA7i3AY1Or+T+hO+2G/t+rfIxnLgIc4p10K7GM2ZxcipK9Z7U6LAtTO0iw==", + "shasum": "96b5a6fa92f8713c240686e9f3dfd5c00df7497e", + "tarball": "http://localhost:4873/@test/c/-/c-1.0.0.tgz" + }, + "contributors": [] + }, + "1.1.0": { + "name": "@test/c", + "version": "1.1.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.1.0" + }, + "_id": "@test/c@1.1.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-BNxNmwGwAhVxA8RQpog/wy/NNZfa5ruskwZePlKfu1zpLVtsrjO8zGau6C/c8iIw9mwrVqBAeBuFpUwJhLTAZA==", + "shasum": "01db72391f551fd7944adbf0f54eaebc389b90c4", + "tarball": "http://localhost:4873/@test/c/-/c-1.1.0.tgz" + }, + "contributors": [] + }, + "1.2.0": { + "name": "@test/c", + "version": "1.2.0", + "description": "", + "main": "index.js", + "scripts": { + "test": "echo \"Error: no test specified\" && exit 1" + }, + "keywords": [], + "author": "", + "license": "ISC", + "type": "commonjs", + "peerDependencies": { + "@test/a": "1.2.0" + }, + "_id": "@test/c@1.2.0", + "_nodeVersion": "22.14.0", + "_npmVersion": "11.4.2", + "dist": { + "integrity": "sha512-pAHdEr8mb8mXuWPQL0mbkyHVulhzVWQ3HvpO9OBZ0azF56p9cr1+hVy/CajxPdEr/Crx6iBfjpoaNYscVPbvMg==", + "shasum": "e915f26882f8bbde7e238c02908bbc5625cf3c4e", + "tarball": "http://localhost:4873/@test/c/-/c-1.2.0.tgz" + }, + "contributors": [] + } + }, + "time": { + "modified": "2025-07-29T13:03:42.407Z", + "created": "2025-07-29T13:03:29.009Z", + "1.0.0": "2025-07-29T13:03:29.009Z", + "1.1.0": "2025-07-29T13:03:36.559Z", + "1.2.0": "2025-07-29T13:03:42.407Z" + }, + "users": {}, + "dist-tags": { + "latest": "1.2.0" + }, + "_rev": "9-19d0ff85a20ff576", + "_id": "@test/c", + "readme": "ERROR: No README data found!", + "_attachments": {} +} \ No newline at end of file diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.0.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.0.0.tgz new file mode 100644 index 0000000000000..65661f1328219 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.0.0.tgz differ diff --git a/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.1.0.tgz b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.1.0.tgz new file mode 100644 index 0000000000000..cdbee76034001 Binary files /dev/null and b/workspaces/arborist/test/fixtures/registry-mocks/content/test/c/c-1.1.0.tgz differ