diff options
author | erik wienhold <git@ewie.name> | 2015-04-11 17:34:53 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-04-11 20:58:53 +0300 |
commit | b0273190c71eba14395ddfdd1d9f7ba625297523 (patch) | |
tree | 72cf63527274dc0ba59056e6ed3323f3ecbc2d53 /lib/install.js | |
parent | 15efe124753257728a0ddc64074fa5a4b9c2eb30 (diff) |
install: scoped packages with peerDependencies
Package scopes cause an additional level in the tree structure which
must be considered when resolving the target folders of a package's
peerDependencies.
Fixes #7454.
Diffstat (limited to 'lib/install.js')
-rw-r--r-- | lib/install.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/install.js b/lib/install.js index 6e94f15b5..6f3f4cf6b 100644 --- a/lib/install.js +++ b/lib/install.js @@ -1128,7 +1128,12 @@ function write (target, targetFolder, context, cb_) { "in npm 3+. Your application will need to depend on it explicitly." ], pd+","+data.name) }) - var pdTargetFolder = path.resolve(targetFolder, "..", "..") + + // Package scopes cause an addditional tree level which needs to be + // considered when resolving a peerDependency's target folder. + var pdTargetFolder = path.resolve(targetFolder, + (target.name[0] === "@" ? "../../.." : "../..")) + var pdContext = context if (peerDeps.length > 0) { actions.push( |