Skip to content

Commit d811461

Browse files
olorezkat
authored andcommittedAug 3, 2018
cli: don't check for updates to npm when we are updating npm itself (#32)
PR-URL: #32 Credit: @olore Reviewed-By: @zkat
1 parent 792c8c7 commit d811461

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎bin/npm-cli.js

+3
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)
Please sign in to comment.