-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Closed
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
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
- 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- Install and run ls --all:
npm install --install-strategy=linked
npm ls --all --install-strategy=linked- 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=linkedReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels