Part of #9608.
Is there an existing issue for this?
This issue exists in the latest npm version
This is not just a request to bump a dependency for a CVE
Current Behavior
In a workspace project using install-strategy=linked, after a normal install, npm install --workspaces=false and npm install -w <ws> --include-workspace-root both exit 1 with npm error invalid filterNode: outside idealTree/actualTree. npm install -w <ws> (without --include-workspace-root) works. The hoisted strategy handles all three without error.
Expected Behavior
--workspaces=false and -w <ws> --include-workspace-root should succeed under the linked strategy, as they do under hoisted.
Steps To Reproduce
cd "$(mktemp -d)"
echo 'install-strategy=linked' > .npmrc
cat > package.json <<'EOF'
{ "name": "root", "version": "1.0.0", "workspaces": ["packages/*"],
"dependencies": { "minimatch": "3.0.4" } }
EOF
mkdir -p packages/a
echo '{ "name": "a", "version": "1.0.0", "dependencies": { "rimraf": "3.0.2" } }' > packages/a/package.json
npm install >/dev/null
npm install --workspaces=false # -> exit 1: invalid filterNode: outside idealTree/actualTree
npm install -w a --include-workspace-root # -> exit 1: same error
# hoisted: both exit 0
Environment
- npm: 12.0.0-pre.1 (
latest)
- Node.js: v24.17.0
- OS Name: macOS (Darwin 25.5.0)
- System Model Name: MacBook (arm64)
- npm config:
Part of #9608.
Is there an existing issue for this?
This issue exists in the latest npm version
This is not just a request to bump a dependency for a CVE
Current Behavior
In a workspace project using
install-strategy=linked, after a normal install,npm install --workspaces=falseandnpm install -w <ws> --include-workspace-rootboth exit 1 withnpm error invalid filterNode: outside idealTree/actualTree.npm install -w <ws>(without--include-workspace-root) works. The hoisted strategy handles all three without error.Expected Behavior
--workspaces=falseand-w <ws> --include-workspace-rootshould succeed under the linked strategy, as they do under hoisted.Steps To Reproduce
Environment
latest)install-strategy=linked