Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2017-07-12 01:22:31 +0300
committerRebecca Turner <me@re-becca.org>2017-07-12 01:22:31 +0300
commit8e979bf80fb93233f19db003f08443e26cfc5e64 (patch)
tree89c49c29fd98907015517c2d2e66ead75c1998a2 /lib
parenta6bb15f9f07dede5cb3d3b27d96dfc482d42a73e (diff)
Revert "install/deps: Stop flattening modules that require peer deps"
This reverts commit 06c154fd653d18725d2e760ba825d43cdd807420. This caused problems because folks were using peer deps to indicate that the target of the peer dep needed to be able to require the dependency and had been relying on the fact that peer deps didn't change the shape of the tree (as of npm@3). The fix that will actually work for people is for a peer dep to insist on never being installed deeper than the the thing it relies on. At the moment this is tricky because the thing the peer dep relies on may not yet have been added to the tree, so we don't know where it is.
Diffstat (limited to 'lib')
-rw-r--r--lib/install/deps.js4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/install/deps.js b/lib/install/deps.js
index 577a39df4..d7a2c27c1 100644
--- a/lib/install/deps.js
+++ b/lib/install/deps.js
@@ -696,10 +696,6 @@ var earliestInstallable = exports.earliestInstallable = function (requiredBy, tr
}
if (tree.children.some(undeletedModuleMatches)) return null
- // Peer deps can't be flattened because we don't know where they'll be installed.
- // We can later add optimiations to flatten the dep if that's valid.
- if (pkg.peerDependencies && Object.keys(pkg.peerDependencies).length) return null
-
// If any of the children of this tree have conflicting
// binaries then we need to decline to install this package here.
var binaryMatches = pkg.bin && tree.children.some(function (child) {