Skip to content

Commit

Permalink
cli: don't check for updates to npm when we are updating npm itself (#32
Browse files Browse the repository at this point in the history
)

PR-URL: #32
Credit: @olore
Reviewed-By: @zkat
  • Loading branch information
olore authored and zkat committed Aug 3, 2018
1 parent 792c8c7 commit d811461
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions bin/npm-cli.js
Expand Up @@ -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
) {
Expand Down

0 comments on commit d811461

Please sign in to comment.