Skip to content
Permalink
Browse files
cli: don't check for updates to npm when we are updating npm itself (#32
)

PR-URL: #32
Credit: @olore
Reviewed-By: @zkat
  • Loading branch information
olore authored and zkat committed Aug 3, 2018
1 parent 792c8c7 commit d8114618137bb5b9a52a86711bb8dc18bfc8e60c
Showing with 3 additions and 0 deletions.
  1. +3 −0 bin/npm-cli.js
@@ -69,12 +69,15 @@
npm.command = 'help'
}

var isGlobalNpmUpdate = conf.global && ['install', 'update'].includes(npm.command) && npm.argv.includes('npm')

// now actually fire up npm and run the command.
// this is how to use npm programmatically:
conf._exit = true
npm.load(conf, function (er) {
if (er) return errorHandler(er)
if (
!isGlobalNpmUpdate &&
npm.config.get('update-notifier') &&
!unsupported.checkVersion(process.version).unsupported
) {

0 comments on commit d811461

Please sign in to comment.