GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [BUG] npm ls command listing EXTRANEOUS package for clean install · Issue #8832 · npm/cli

[BUG] npm ls command listing EXTRANEOUS package for clean install #8832

New issue
Copy link
New issue
Copy link
Closed
#9221
Closed
[BUG] npm ls command listing EXTRANEOUS package for clean install#8832
#9221
Copy link
Labels
Bugthing that needs fixingNeeds Triageneeds review for next steps

Description

@Chardrazle
Chardrazle
opened on Dec 5, 2025
Issue body actions

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

Current Behavior

The npm lscommand lists an EXTRANEOUS package, that doesn't appear to be removable.
Not sure if it's an upstream package dependency problem, mind.

Expected Behavior

No EXTRANEOUS package.

Steps To Reproduce

With package.json:

{
  "name": "test",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "dev": "next dev",
    "build": "next build",
    "start": "next start",
    "lint": "eslint ."
  },
  "dependencies": {
    "@tanstack/react-query": "^5.90.12",
    "@uidotdev/usehooks": "^2.4.1",
    "axios": "^1.13.2",
    "bootstrap": "^5.3.8",
    "next": "^16.0.7",
    "next-auth": "^5.0.0-beta.27",
    "react": "^19.2.1",
    "react-bootstrap": "^2.10.10",
    "sharp": "^0.34.5",
    "zod": "^4.1.13"
  },
  "devDependencies": {
    "@types/node": "^24.10.1",
    "baseline-browser-mapping": "^2.9.2",
    "eslint": "^9.39.1",
    "eslint-config-next": "^16.0.7",
    "typescript": "^5.9.3"
  }
}

Steps:

$ rm -rf node_modules/ package-lock.json
$ npm i
...
$ npm ls --all --parseable --long --omit=dev --omit=optional | grep EXT
.../npm_test/node_modules/@emnapi/runtime:@emnapi/[email protected]:EXTRANEOUS

Environment

$ uname -ra
Linux <hostname> 6.1.0-41-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.1.158-1 (2025-11-09) x86_64 GNU/Linux
$ npm config ls
; node bin location = .../.nvm/versions/node/v22.14.0/bin/node
; node version = v22.14.0
; npm local prefix = .../npm_test
; npm version = 11.6.4
; cwd = .../npm_test
; HOME = ...
; Run `npm config ls -l` to show all defaults.
Reacted by jesvinjames, koooge and Lovell Fuller

Activity

  1. Chardrazle
    added
    Bugthing that needs fixing
    Needs Triageneeds review for next steps
    on Dec 5, 2025
  2. jesvinjames commented on Jan 11, 2026

    @jesvinjames
    jesvinjames
    on Jan 11, 2026
    More actions

    This issue can be reproduced with just unrs-resolver and sharp. Both have optional dependencies that depends on @emnapi/runtime.
    @emnapi/runtime is installed although their parent optional dependencies @unrs/resolver-binding-wasm32-wasi and @img/sharp-wasm32 are not installed as they do not meet the system requirements. Only @emnapi/runtime and tslib are installed erroneously. Other dependencies of optional dependencies are not installed as expected.

    Minimum reproduction

    npm install [email protected] [email protected]
    

    package-lock.json in case transitive dependencies change.

    Dependency graph of unrs-resolver including optional dependencies

    Image

    Dependency graph of sharp including optional dependencies

    Image

    npm ls --all output

    npm-extraneous@ /npm-extraneous
    +-- @emnapi/[email protected] extraneous
    | `-- [email protected] deduped
    +-- [email protected]
    | +-- @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- @img/[email protected]
    | | `-- @img/[email protected] deduped
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- UNMET OPTIONAL DEPENDENCY @img/[email protected]
    | +-- [email protected]
    | `-- [email protected]
    +-- [email protected] extraneous
    `-- [email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      +-- UNMET OPTIONAL DEPENDENCY @unrs/[email protected]
      `-- [email protected]
    

    Installed packages

    node_modules/@unrs/resolver-binding-linux-x64-gnu
    node_modules/@img/colour
    node_modules/@img/sharp-libvips-linux-x64
    node_modules/@img/sharp-linux-x64
    node_modules/@emnapi/runtime
    node_modules/unrs-resolver
    node_modules/detect-libc
    node_modules/semver
    node_modules/tslib
    node_modules/napi-postinstall
    node_modules/sharp
    

    npm config ls output

    ; node bin location = /usr/local/bin/node
    ; node version = v24.8.0
    ; npm local prefix = /npm-extraneous
    ; npm version = 11.7.0
    ; cwd = /npm-extraneous
    ; HOME = /root
    ; Run `npm config ls -l` to show all defaults.
    
  3. lovell commented on Apr 5, 2026

    @lovell
    lovell
    on Apr 5, 2026
    Contributor
    More actions

    Advance warning for npm maintainers: this issue is likely to become more prevalent as it appears to affect the next version of sharp without any other dependencies involved.

    Here's a quick way to reproduce using only the latest v0.35.0-rc.2 release candidate:

    $ node -v
    v24.14.1
    
    $ npm -v
    11.11.0
    
    $ npm install [email protected]
    added 9 packages in 2s
    
    $ npm ls --all
    ├─┬ @emnapi/[email protected] extraneous
    │ └── [email protected] deduped
    ├─┬ @img/[email protected] extraneous
    │ └── @emnapi/[email protected] deduped
    ├─┬ [email protected]
    │ ├── @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├─┬ @img/[email protected]
    │ │ └── @img/[email protected] deduped
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── UNMET OPTIONAL DEPENDENCY @img/[email protected]
    │ ├── [email protected]
    │ └── [email protected]
    └── [email protected] extraneous
    

    In this example on the linux-x64 platform, the dependencies marked "UNMET OPTIONAL" are correctly not installed but the dependencies marked "extraneous" are incorrectly installed.

    If there's something that sharp is doing wrong then please let me know and I'll fix it.

  4. lovell commented on Apr 13, 2026

    @lovell
    lovell
    on Apr 13, 2026
    Contributor
    More actions

    I've opened a PR with a possible fix for this at #9221

    (As an aside, I think this issue might have been exposed due to the change in #8537.)

  5. wraithgar
    closed this as completedin #9221on Apr 15, 2026
  6. wraithgar
    added a commit that references this issue on Apr 15, 2026

    fix(arborist): do not install inert optional extraneous shared depend…

    1d058b0
  7. github-actions
    added a commit that references this issue on Apr 15, 2026

    fix(arborist): do not install inert optional extraneous shared depend…

    b908353
  8. reggi
    added a commit that references this issue on Apr 21, 2026

    fix(arborist): do not install inert optional extraneous shared depend…

    555e01b
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Bugthing that needs fixingNeeds Triageneeds review for next steps

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402792 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.