From 1c90cbb6097c546928e1b9e6d19ee9c59bfac378 Mon Sep 17 00:00:00 2001 From: Marcin Cieslak Date: Mon, 6 Jul 2015 23:17:00 +0000 Subject: 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 --- lib/build.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib') 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') -- cgit v1.2.3