Skip to content

Commit

Permalink
install: don't warn on preferGlobal for devDeps
Browse files Browse the repository at this point in the history
Followup-To: npm/npm#1648
Fixes: npm/npm#8517
PR-URL: npm/npm#9409
PR-URL: npm/npm#8841
  • Loading branch information
saper authored and othiym23 committed Aug 27, 2015
1 parent 79f5f27 commit 1c90cbb
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand Down

0 comments on commit 1c90cbb

Please sign in to comment.