[BUG] npm self-upgrade on Node 24.14.1 (npm 11.11.0 → 11.15.0) crashes with "Class extends value undefined" due to stale minipass@3.x
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 10.1k
- Forks
- 4.7k
- Avg merge
- 2d 2h
- Merged PRs (30d)
- 19
Description
Upgrading npm globally on Node 24.14.1 (bundled npm 11.11.0) to any version >= 11.13.0 leaves a stale minipass@3.3.6 nested inside minipass-flush/node_modules/. After upgrade, any npm command crashes:
$ npm list -g --depth=0 npm error Class extends value undefined is not a constructor or null
Root Cause
minipass-flush@1.0.6 (introduced in npm 11.13.0) does: const { Minipass } = require('minipass') // expects named export from minipass@7.x
But Arborist leaves a stale nested minipass@3.3.6 in minipass-flush/node_modules/minipass/ during the self-upgrade. minipass@3.x uses default export → Minipass is undefined → crash.
Steps To Reproduce
# Fresh Node 24.14.1 (npm 11.11.0 bundled)
nvm install 24.14.1
npm install -g npm@11.15.0
npm list -g --depth=0 # CRASHES
Stepping-stone approach does NOT help:
npm install -g npm@11.12.1 # intermediate
npm install -g npm@11.15.0 # still leaves stale minipass
npm list -g --depth=0 # CRASHES
Workaround
npm install -g npm@11.15.0
rm -rf $(npm root -g)/npm/node_modules/minipass-flush/node_modules
npm list -g --depth=0 # works
npm install -g npm@latest should complete without corrupting its own dependency tree.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing the failure with Node 24.14.1 and npm 11.15.0 using the commands in the issue, then inspect npm's dependency tree around npm/node_modules/minipass-flush/node_modules/. Trace how the self-upgrade leaves minipass@3.3.6 in place. Done means npm install -g npm@latest completes without corrupting the tree and npm list -g --depth=0 no longer crashes.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript, nodejs
- Domain
- cli, tooling
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 50/100