Repository navigation
Description
Is there an existing issue for this?
- I have searched the existing issues
This issue exists in the latest npm version
- I am using the latest npm
This is not just a request to bump a dependency for a CVE
- This is not solely a request to bump a dependency for a CVE
Current Behavior
3835 verbose stack TypeError: Cannot read properties of null (reading 'edgesOut')
3835 verbose stack at #loadPeerSet (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1289:38)
3835 verbose stack at async #loadPeerSet (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:1297:11)
3835 verbose stack at async #buildDepStep (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:904:11)
3835 verbose stack at async Arborist.buildIdealTree (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/build-ideal-tree.js:181:7)
3835 verbose stack at async Promise.all (index 1)
3835 verbose stack at async Arborist.reify (/usr/lib/node_modules/npm/node_modules/@npmcli/arborist/lib/arborist/reify.js:131:5)
3835 verbose stack at async Install.exec (/usr/lib/node_modules/npm/lib/commands/install.js:150:5)
3835 verbose stack at async Npm.exec (/usr/lib/node_modules/npm/lib/npm.js:207:9)
3835 verbose stack at async module.exports (/usr/lib/node_modules/npm/lib/cli/entry.js:74:5)
{
"name": "nuxt-app",
"private": true,
"scripts": {
"dev": "nuxt dev",
"build": "nuxt build",
"analyze": "nuxt analyze --serve",
"generate": "nuxt generate",
"preview": "nuxt preview",
"postinstall": "nuxt prepare",
"generate-pwa-assets": "pwa-assets-generator",
"typecheck": "nuxt typecheck",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"prestart": "test -f .output/server/index.mjs || npm run build",
"start": "node .output/server/index.mjs",
"start:prod": "NODE_ENV=production node .output/server/index.mjs"
},
"engines": {
"node": ">=20.0.0"
},
"devDependencies": {
"@nuxt/eslint-config": "^1.15.2",
"@nuxtjs/device": "^3.2.4",
"@nuxtjs/google-fonts": "^3.2.0",
"@nuxtjs/i18n": "^9.5.3",
"@tailwindcss/aspect-ratio": "^0.4.2",
"@tailwindcss/forms": "^0.5.10",
"@types/lodash-es": "4.17.12",
"@vite-pwa/assets-generator": "^1.0.0",
"@vite-pwa/nuxt": "^1.0.0",
"autoprefixer": "^10.4.21",
"eslint": "^9.39.3",
"nuxt": "3.21.1",
"nuxt-gtag": "^3.0.2",
"nuxt-purgecss": "^2.0.0",
"postcss": "^8.5.1",
"tailwindcss": "^3.4.10"
},
"dependencies": {
"@headlessui/vue": "^1.7.23",
"@heroicons/vue": "^2.2.0",
"@microsoft/signalr": "^8.0.7",
"@nuxt/image": "^1.10.0",
"@pinia/nuxt": "^0.11.0",
"@tawk.to/tawk-messenger-vue-3": "^1.0.3",
"@vuepic/vue-datepicker": "^11.0.2",
"@vueuse/components": "^13.1.0",
"@vueuse/core": "^13.1.0",
"color": "^5.0.0",
"crypto-js": "^4.2.0",
"eventemitter3": "^5.0.1",
"gsap": "^3.12.7",
"lodash-es": "^4.17.21",
"lottie-web": "5.12.2",
"mersenne-twister": "^1.1.0",
"nuxt-toast": "^1.1.4",
"pinia": "^3.0.2",
"qrcode-vue3": "^1.7.1",
"sass": "^1.86.3",
"swiper": "^11.2.6",
"vue-chartjs": "^5.3.3",
"vue3-marquee": "^4.2.2",
"jsqr": "^1.4.0"
}
}
node v22.21.0
npm v10.8.2
Expected Behavior
No response
Steps To Reproduce
- In this environment...
- With this config...
- Run '...'
- See error...
Environment
- npm:
- Node.js:
- OS Name:
- System Model Name:
- npm config:
; copy and paste output from `npm config ls` here
Activity
v-kchindam-infy commentedon Jul 21, 2026
@Jora28 I'm unable to reproduce the issue with the current information. Can you please share the exact steps to reproduce the issue. this looks to be similar if not a duplicate of an existing issue #8261
Tkkg1994 commentedon Jul 22, 2026
I hit this too and managed to reduce it to a one-dependency reproduction. Posting the details since the issue is currently marked as hard to reproduce.
Minimal reproduction
{ "name": "repro", "version": "1.0.0", "private": true, "dependencies": { "@vitejs/devtools": "*" } }Same crash site as the original report (
#loadPeerSet,build-ideal-tree.js:1289). No lock file and nonode_modulesneeded — it fails during ideal-tree construction.The trigger is the range, not the resolved version
This is the part I found most interesting. All three resolve to the same version (
0.4.2), but only the wildcard crashes:@vitejs/devtoolsrange"*"Cannot read properties of null (reading 'edgesOut')"^0.4.2""0.4.2"Verified deterministic — repeated in fresh directories with a clean cache state, consistently reproducible.
Version matrix
{"@vitejs/devtools": "*"}reading 'edgesOut'(build-ideal-tree.js:1289)reading 'children'(place-dep.js:299){"nuxt": "3.21.1"}reading 'edgesOut'{"nuxt": "4.5.0"}reading 'edgesOut'{"@nuxt/vite-builder": "4.5.0"}reading 'edgesOut'{"vite": "*"}Two notes on npm 11: it still crashes on the isolated
@vitejs/devtoolscase, just with a different null dereference. But on a larger real-world manifest that pulls@vitejs/devtoolsin transitively it resolved fine (1070 packages), presumably because the surrounding constraints keep the graph from reaching the bad state. So npm 11 is not a general fix here.Why it's null
build-ideal-tree.js:1289in arborist 8.0.5 is:so
node.parentisnull. The stack shows#loadPeerSetrecursing into itself (line 1297 → 1289), i.e. the node gets detached from its parent partway through recursive peer-set resolution and is then dereferenced unguarded. The npm 11 failure is the same shape one layer over —virtualRoot.childrenatplace-dep.js:299with a nullvirtualRoot.The likely reason
@vitejs/devtoolsprovokes it is its peer block — four optional peers that are self-referential siblings at the same version, plus a wildcard:Each of those sub-packages installs cleanly on its own; only the parent that declares the optional-sibling peer set crashes.
Why Nuxt users are the ones reporting this
nuxt→@nuxt/vite-builder→@vitejs/devtools. Since npm auto-installs peers, anything that peer-depends on@nuxt/schemaornuxtdrags the whole builder toolchain in.{"nuxt": "3.21.1"}— the version in the original report — reproduces the exactedgesOuterror as a single dependency on npm 10.I ran into it in a different context: a Nuxt/Nitro server bundle that externalises a package peer-depending on
@nuxt/schema, deployed to Firebase Cloud Functions. The Node 22 buildpack ships npm 10, so the deploy build died with this error while a local npm 11 install of the same manifest succeeded.Workaround
Skipping peer auto-install avoids it, since none of that tooling is needed at runtime:
Confirmed:
{"@vitejs/devtools": "*"}goes from crash to OK on npm 10.9.8 with that set. Pinning the offending package to an exact or caret range instead of*also works, where you control the range.Environment
@vitejs/devtoolsresolved to0.4.2at time of testing — noting it since the*range is what makes this reproduce, so future registry state may shift which version you land on.AswinDhurai01 commentedon Jul 28, 2026
@Jora28 Actually, I also faced this issue. This issue is resolved by updating the nodejs and npm version to their latest versions.
Upgraded Node.js (v22.21.1 → v24.x) and npm (v10.9.4 → v11.x), resolving the npm install failure.
[-][BUG] <title> npm install npm error Cannot read properties of null (reading 'edgesOut')[/-][+][BUG] npm install npm error Cannot read properties of null (reading 'edgesOut')[/+]fix(ci): SMI-5931 resolve retrieval-eval-gate vitest from npm ci (#2199)
blove commentedon Aug 9, 2026
I hit this through a generated application, then reduced that real-world graph to a second one-dependency reproduction that may help pin the affected peer-set shape.
Minimal reproduction
{ "name": "vitest-edgesout-repro", "version": "1.0.0", "private": true, "devDependencies": { "vitest": "4.1.4" } }From a fresh directory with no lock file or
node_modules:Result:
The verbose stack is the same recursive
#loadPeerSetpath reported above:I repeated it with a new, isolated npm cache and
--prefer-online; it failed identically.Version boundary
Using otherwise identical one-dependency manifests:
[email protected]edgesOut[email protected]edgesOut[email protected]vitest@^4.1.10For
[email protected]:edgesOut--legacy-peer-depsalso makes the npm 10.9.9 install succeed.The npm 10 verbose fetch sequence reaches
@vitejs/devtoolsand its optional sibling peers immediately before the recursive#loadPeerSetfailure, so this appears consistent with the optional-peer analysis in the reproduction above. The original application dependency graph is not required to trigger it.Environment:
fix(deps): remove redundant knip devDependency, fixing CI npm ci
feat: add code-health-auditor skill (dead-code/consolidation scanner) (…
erwanriou commentedon Aug 18, 2026
Deterministic reproduction (hit us in CI twice in 2 months; this instance reproduces locally every time):
{ "devDependencies": { "vitest": "4.1.10", "jsdom": "29.1.1", "vite": "7.1.1" } }npm install --force(no lockfile) ->TypeError: Cannot read properties of null (reading 'edgesOut')at#loadPeerSet(build-ideal-tree.js:1297), npm 10.9.2 / node 22.13.1.Trigger:
[email protected]was published ~90 seconds before our install ran. vitest declares its family (@vitest/browser-playwright,@vitest/coverage-v8, ...) as optional peers pinned to its own version; with the root pinned to4.1.10and the registry's latest at4.1.11, evaluating that optional peer set - for packages we never install - crashes the resolver instead of raising a readableERESOLVE. Aligning the root pin to4.1.11makes the install pass, which is how we isolated the peer-set version skew as the trigger.Notable: the crash comes from the declaration of an optional peer alone -
@vitest/browser-playwrightis never installed in this tree (npm ls-> empty).Full
--verbosestack and debug log available on request.52 remaining items
ci: upgrade npm to 11 on Node 22 runners
chore: update Nx workspace to 23.3.0 (#790)
fix(deps): 同步主线消解并发 PR 的 lock 冲突,npm 侧不做重建
agent-buffy: CF Pages fix - nvmrc version first, and the npm/cli#9787 …
agent-buffy: the vant-brain Pages crash fixed at both legs - the stal…
fix(audit-tests): the toys install with --legacy-peer-deps; npm error…
fix(audit-tests): the toys install with --legacy-peer-deps; npm error…
fix: work around npm/arborist crash with --legacy-peer-deps
RicardoRB commentedon Oct 29, 2026
We hit the same
edgesOutcrash and tested which npm versions are affected. Repro and results:Repro (empty directory, no lockfile, Node 22.12.0):
Results
Cannot read properties of null (reading 'edgesOut')The same npm 10.9.9 also fails on Node 22.23.4, so a newer Node 22 patch doesn't avoid it.
[email protected]installs on npm 10.9.x.Takeaway for us: the crash needs npm 11.6.0 or later. Node 22 still bundles npm 10.9.x, so CI on Node 22 has to upgrade npm first. If you want a different repro, we can provide one.
khaled-maruf commentedon Nov 5, 2026
@v-kchindam-infy , any reason #8261 was fixed in 11+ but not in 10+ which gets shipped with node22?
khaled-maruf commentedon Nov 5, 2026
cc: @milaninfy @isaacs
Thoemmy commentedon Nov 13, 2026
We have the same problem with edges out and funny is the fact that it also includes vite as some indicator.
vite and @vitejs/devtools is installed in our angular project and since then i need to make overrides in the package.json of vite so that the "null" error of edgesOut is dissapearing.
haigou-web commentedon Nov 13, 2026
Checked the actually shipped code rather than the changelog, since this decides whether a 10.x backport is even possible.
The guard does not exist anywhere on the 8.x line.
[email protected](latest 10.x) still pins@npmcli/arborist@^8.0.5, and 8.0.5 is the last release on that branch. Fetchinglib/arborist/build-ideal-tree.jsfrom each tag and grepping for the guard:if (!node.parent)guardSo it isn't "fixed in 11 but forgotten for 10" — the fix was never applied to the major line npm 10 consumes, and that line has had no release since 8.0.5. Nothing on 8.x can pick it up by a dependency bump.
That does not answer whether maintainers intend to backport it — that's their call, I'm just here from the same crash. But it explains the shape of the problem: Node 22 still bundles npm 10.9.x, so anyone on Node 22 needs either #8448 landing on arborist 8.x, or to upgrade npm independently of Node.
Practical escape hatch for the Node 22 crowd — verified by @kimbutton in the comment above: run
npx --yes npm@11 installonce to regenerate the lockfile, then the original npm 10.9.x consumes it fine for bothinstallandci. The bug only bites during ideal-tree construction, not when reading an already-resolved lockfile.--legacy-peer-depsis not an alternative — the same comment found it produces a lockfile that then failsnpm ciwithMissing: [email protected] from lock file.khaled-maruf commentedon Nov 13, 2026
It doesn't look like a
practicalescape hatch TBH. If Node 22 is still in maintenance phase then anything coming with it shouldn't contain things that breaks existing usages. That's what maintenance is all about. If upgrading to npm11 is the solution, then that should've been shipped by the package itself.nkolev92 commentedon Nov 24, 2026
Hey folks,
Thank you for the discussion.
As indicated, 10 and 11 use different versions of arborist and at this point, we're only considering security fixes for 10, and don't want to add additional risk.