Skip to content

Auto-installing peer dependencies in npm@7. #289

Answered by isaacs
jansiegel asked this question in General
Discussion options

You must be logged in to vote

I have a question about auto-installing peer dependencies.

In this PR @isaacs mentions that:

we should never place a dep in a target where the target has a peerDep on that dependency

while the Install Peer Dependencies RFC states that:

Ensure that a validly matching peer dependency is found at or above the peer-dependant's location in the node_modules tree.

Subtle distinction: "in" vs "at".

If foo has a peerDep on bar, and foo is installed at .../node_modules/foo then we may not install bar at .../node_modules/foo/node_modules/bar. That would be "in" foo as the "target" in the terminology used within Arborist. It must be placed at foo's level or higher. Ie, at .../node_modules/bar o…

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@jansiegel
Comment options

Answer selected by ruyadorno
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
3 participants