-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Closed as duplicate of#8464
Closed as duplicate of#8464
Copy link
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps
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
Suppose my package A depends on package B which peer-depends on package C which optionally depends on package D.
As of npm@11.5
, npm install
does not install D nor write it to the package lock.
This was introduced in #8431, which intended to prune optional peer dependencies. But optional peer dependencies are not the same as optional dependencies of peer dependencies, and this PR as written also affects the latter.
Expected Behavior
npm install
should install D, as it did prior to npm@11.5.0
.
Steps To Reproduce
- Create a new package A which depends on package B which peer-depends on package C which optionally depends on package D.
- Run
npm install
. - Observe that D does not exist in the package lock or node_modules.
Environment
- npm: 11.5.2
- Node.js: 22.18.0
- OS Name: macOS
- System Model Name: MacBook Pro
- npm config: default
chabb
Metadata
Metadata
Assignees
Labels
Bugthing that needs fixingthing that needs fixingNeeds Triageneeds review for next stepsneeds review for next steps