Skip to content

Commit 692ce93

Browse files
committed
cli: don't check for updates to npm when we are updating npm itself
1 parent 4f801d8 commit 692ce93

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

bin/npm-cli.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,12 +69,15 @@
6969
npm.command = 'help'
7070
}
7171

72+
var isGlobalNpmUpdate = conf.global && ['install', 'update'].includes(npm.command) && npm.argv.includes('npm');
73+
7274
// now actually fire up npm and run the command.
7375
// this is how to use npm programmatically:
7476
conf._exit = true
7577
npm.load(conf, function (er) {
7678
if (er) return errorHandler(er)
7779
if (
80+
!isGlobalNpmUpdate &&
7881
npm.config.get('update-notifier') &&
7982
!unsupported.checkVersion(process.version).unsupported
8083
) {

0 commit comments

Comments
 (0)