diff options
author | Marcin Cieslak <saper@saper.info> | 2015-07-07 02:17:00 +0300 |
---|---|---|
committer | Forrest L Norvell <forrest@npmjs.com> | 2015-08-28 02:54:38 +0300 |
commit | 1c90cbb6097c546928e1b9e6d19ee9c59bfac378 (patch) | |
tree | 8f8394a9f4abe5df08395b957c81d8b46a7ff4a0 /lib | |
parent | 79f5f271999fc249780c05f36a2a48624a0a23ed (diff) |
install: don't warn on preferGlobal for devDeps
Followup-To: https://github.com/npm/npm/issues/1648
Fixes: https://github.com/npm/npm/issues/8517
PR-URL: https://github.com/npm/npm/pull/9409
PR-URL: https://github.com/npm/npm/pull/8841
Diffstat (limited to 'lib')
-rw-r--r-- | lib/build.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/build.js b/lib/build.js index 7793a07b6..8d62cb61f 100644 --- a/lib/build.js +++ b/lib/build.js @@ -135,7 +135,9 @@ function shouldWarn (pkg, folder, global, cb) { if (linkedPkg !== currentPkg) { // don't generate a warning if it's listed in dependencies - if (Object.keys(topPkg.dependencies || {}).indexOf(currentPkg) === -1) { + if (Object.keys(topPkg.dependencies || {}) + .concat(Object.keys(topPkg.devDependencies || {})) + .indexOf(currentPkg) === -1) { if (top && pkg.preferGlobal && !global) { log.warn('prefer global', getPackageId(pkg) + ' should be installed with -g') |