Skip to content

[BUG] install-strategy=linked: --workspaces=false and --include-workspace-root fail with invalid filterNode #9614

Description

@manzoorwanijk

Part of #9608.

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

This is not just a request to bump a dependency for a CVE

  • This is not solely 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:
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