Skip to content

Commit

Permalink
cli: don't check for updates to npm when we are updating npm itself
Browse files Browse the repository at this point in the history
  • Loading branch information
olore committed Jul 31, 2018
1 parent 4f801d8 commit d905508
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 d905508

Please sign in to comment.