diff options
author | Forrest L Norvell <forrest@npmjs.com> | 2015-03-06 09:49:56 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-03-06 09:49:56 +0300 |
commit | 39032e745ef6f610f489d429292df350d556ccc7 (patch) | |
tree | 2a7c9db8b5b3073d9a20186d5e5c47226958a421 | |
parent | c618eeda3e321fd454d77c476b53a0330f2344cc (diff) |
install: tweak install --link for git
`_resolved` isn't guaranteed to be set on the package metadata by this
point in the installation process, and we probably shouldn't
automatically assume that `_from` is set, either.
-rw-r--r-- | lib/install.js | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/install.js b/lib/install.js index acfc2aeb7..1a235793d 100644 --- a/lib/install.js +++ b/lib/install.js @@ -868,7 +868,8 @@ function targetResolver (where, context, deps) { function installOne (target, where, context, cb) { // the --link flag makes this a "link" command if it's at the // the top level. - var isGit = npa(target._resolved).type === "git" + var isGit = false + if (target && target._from) isGit = npa(target._from).type === 'git' if (where === npm.prefix && npm.config.get("link") && !npm.config.get("global") && !isGit) { |