Skip to content

[BUG] linked strategy: npm ls --all reports false UNMET DEPENDENCYs for devDeps of store packages #9092

@manzoorwanijk

Description

@manzoorwanijk

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

npm ls --all --install-strategy=linked reports devDependencies of installed packages (e.g. tap, @npmcli/eslint-config, @npmcli/template-oss) as UNMET DEPENDENCY. These are correctly omitted during install but npm ls --all reads the full package.json from the store and reports them as missing.

This affects both workspace and non-workspace projects. It does not happen with the hoisted strategy.

Expected Behavior

npm ls --all should not report devDependencies of non-root packages as UNMET DEPENDENCY. The hoisted strategy handles this correctly.

Steps To Reproduce

  1. Create a simple project:
mkdir test-lsall && cd test-lsall

cat > package.json << 'EOF'
{
  "name": "test-lsall",
  "version": "1.0.0",
  "dependencies": { "nopt": "^7.0.0" }
}
EOF
  1. Install and run ls --all:
npm install --install-strategy=linked
npm ls --all --install-strategy=linked
  1. Output:
test-lsall@1.0.0
└─┬ nopt@7.2.1 -> ./node_modules/.store/nopt@7.2.1-.../node_modules/nopt
  ├── UNMET DEPENDENCY @npmcli/eslint-config@^4.0.0
  ├── UNMET DEPENDENCY @npmcli/template-oss@4.22.0
  ├─┬ abbrev@2.0.0 -> ./node_modules/.store/abbrev@2.0.0-.../node_modules/abbrev
  │ ├── UNMET DEPENDENCY @npmcli/eslint-config@^4.0.0
  │ ├── UNMET DEPENDENCY @npmcli/template-oss@4.8.0
  │ └── UNMET DEPENDENCY tap@^16.3.0
  └── UNMET DEPENDENCY tap@^16.3.0

The UNMET DEPENDENCY entries (tap, @npmcli/eslint-config, @npmcli/template-oss) are devDependencies of nopt and abbrev that were correctly not installed.

Environment

  • npm: 11.11.0
  • Node.js: v22.20.0
  • OS Name: macOS (Darwin 25.3.0)
  • System Model Name: Mac
  • npm config:
install-strategy=linked

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions