You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[BUG] install-strategy=linked: Installed transitive optional dependency is not materialized in the actual tree with install-strategy=linked #9627
Scope: this affects transitive optional dependencies — ones a non-root package depends on, which under linked live as siblings in the store. A root-declared optional dependency works correctly (it is symlinked into the top-level node_modules and loaded as a direct child of the root, so it never relies on the affected code path). This is the general root cause behind the "extension-added optional dep reported UNMET" finding (sweep BUG 15); the trigger there is not the extension but that the optional dep is transitive.
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
Under install-strategy=linked, an optional dependency that is actually installed is missing from the tree that loadActual builds. The package is present on disk — extracted into node_modules/.store, with a valid symlink into its consumer's store node_modules — yet read commands that walk the actual tree do not see it:
npm ls reports UNMET OPTIONAL DEPENDENCY fsevents@~2.3.2, even though fsevents is installed.
npm sbom omits the package entirely (undercounts components versus hoisted).
Hoisted produces the correct result for the same dependency set (fsevents@2.3.3 shown by ls, present in the SBOM).
This is distinct from the transitive-devDependencies ESBOMPROBLEMS bug (#9610): there the linked tree reported too many required edges; here an installed optionalDependency is reported as unmet/absent (too few).
Expected Behavior
An optional dependency that is installed in the store must appear in the actual tree under install-strategy=linked, identical to the hoisted strategy — npm ls should show it as installed (not UNMET), and npm sbom should include it.
Steps To Reproduce
cd"$(mktemp -d)"echo'install-strategy=linked'> .npmrc
cat > package.json <<'EOF'{ "name": "opt", "version": "1.0.0", "dependencies": { "chokidar": "3.6.0" } }EOF
npm install >/dev/null
# fsevents IS installed in the store:
ls node_modules/.store | grep fsevents
# fsevents@2.3.3-...# ...but the actual tree does not see it:
npm ls --all | grep -i fsevents
# UNMET OPTIONAL DEPENDENCY fsevents@~2.3.2
npm sbom --sbom-format=cyclonedx | grep -c fsevents
# 0
changed the title [-][BUG] install-strategy=linked: Installed transitive optional dependency is not materialized in the actual tree with `install-strategy=linked`[/-][+][BUG] `install-strategy=linked`: Installed transitive optional dependency is not materialized in the actual tree with `install-strategy=linked`[/+]on Jun 24, 2026
Activity
[-][BUG] install-strategy=linked: Installed transitive optional dependency is not materialized in the actual tree with `install-strategy=linked`[/-][+][BUG] `install-strategy=linked`: Installed transitive optional dependency is not materialized in the actual tree with `install-strategy=linked`[/+]fix(arborist): load transitive optional deps into linked actual tree (n…