Skip to content

[pull] latest from npm:latest#178

Merged
pull[bot] merged 3 commits into
DavidLacombe46:latestfrom
npm:latest
Jun 8, 2026
Merged

[pull] latest from npm:latest#178
pull[bot] merged 3 commits into
DavidLacombe46:latestfrom
npm:latest

Conversation

@pull

@pull pull Bot commented Jun 8, 2026

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

manzoorwanijk and others added 3 commits June 8, 2026 10:30
#9510)

In continuation of our exploration of using `install-strategy=linked` in
the [Gutenberg
monorepo](WordPress/gutenberg#75814), which
powers the WordPress Block Editor.

Under `install-strategy=linked` with `allow-remote=root`, a fresh
install fails with `EALLOWREMOTE` on a genuine remote (non-registry)
tarball that is a direct dependency of the project root or a workspace.
The standard (hoisted) reifier installs the same dependency fine under
`allow-remote=root`; only the linked strategy rejects it.

```
npm error code EALLOWREMOTE
npm error Fetching non-root packages of type "remote" have been disabled
npm error Refusing to fetch "@react-native-community/slider@https://raw.githubusercontent.com/wordpress-mobile/react-native-slider/v3.0.2-wp-5/react-native-community-slider-3.0.2-wp-5.tgz"
```

## Why

The `allow-remote=root` gate is enforced at reify time by computing
`_isRoot` and passing it to `pacote.extract` in `reify.js`. A node
counts as "root" if it satisfies at least one valid dependency edge from
the project root or a workspace, which is derived from `node.edgesIn`.
In the linked strategy, store nodes are `IsolatedNode` instances with no
`edgesIn` to recompute root-ness from, so `_isRoot` was always `false`,
every remote tarball was treated as non-root, and pacote refused even a
legitimate root/workspace direct dependency.

This is the sibling of the registry-tarball fix (#9495). That change
carried `isRegistryDependency` onto store nodes so the registry-tarball
exemption still applied; this change carries the analogous root-ness
signal so the `allow-remote=root` gate resolves correctly for genuine
remote tarballs, which are not registry-mediated and so do not qualify
for the registry exemption.

This only widens `allow-remote=root`. `allow-remote=none` still rejects
all remote specs (pacote refuses regardless of `_isRoot`), and a
genuinely transitive remote dependency still fails the resolution-layer
`#checkAllow` gate during ideal-tree construction. Hoisted is unaffected
because its nodes retain real `edgesIn`.

## How

Carry a root-ness flag from the source tree node onto the store node,
rather than weakening the guard:

1. `IsolatedNode` gains an `isRootDependency` field (default `false`),
settable from constructor options.
2. `#externalProxy` computes `isRootDependency` from the real tree
node's `edgesIn` using the same predicate the reifier applies (a valid
edge from the project root or a workspace).
3. `#generateChild` passes it through to the store `IsolatedNode`.
4. The `_isRoot` computation in `reify.js` falls back to
`node.isRootDependency`. Hoisted nodes do not have the property, so they
fall through to the existing edge-based check unchanged.

## References

Fixes #9509
Follows-up #9495
@pull pull Bot locked and limited conversation to collaborators Jun 8, 2026
@pull pull Bot added the ⤵️ pull label Jun 8, 2026
@pull pull Bot merged commit 4e2496a into DavidLacombe46:latest Jun 8, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants