diff --git a/bin/npm-cli.js b/bin/npm-cli.js index a38009d276e3..e4da63c9795d 100755 --- a/bin/npm-cli.js +++ b/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 ) {