Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix update-notifier using deprecated -g config #5300

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -847,3 +847,4 @@ Patryk Ludwikowski <psychoxivi@gmail.com>
Takuya N <takninnovationresearch@gmail.com>
Neel Dani <neeldani@github.com>
Anton Rieder <1301152+aried3r@users.noreply.github.com>
Dimitri Masson <5263585+dhmmasson@users.noreply.github.com>
2 changes: 1 addition & 1 deletion lib/utils/update-notifier.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ const updateNotifier = async (npm, spec = 'latest') => {
const latestc = !useColor ? latest : chalk.green(latest)
const changelog = `https://github.com/npm/cli/releases/tag/v${latest}`
const changelogc = !useColor ? `<${changelog}>` : chalk.cyan(changelog)
const cmd = `npm install -g npm@${latest}`
const cmd = `npm install --location=global npm@${latest}`
const cmdc = !useColor ? `\`${cmd}\`` : chalk.green(cmd)
const message = `\nNew ${typec} version of npm available! ` +
`${oldc} -> ${latestc}\n` +
Expand Down
24 changes: 12 additions & 12 deletions tap-snapshots/test/lib/utils/update-notifier.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -9,94 +9,94 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations major to

New major version of npm available! 122.420.69 -> 123.420.69
Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
Run npm install -g npm@123.420.69 to update!
Run npm install --location=global npm@123.420.69 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations major to current > no color 1`] = `

New major version of npm available! 122.420.69 -> 123.420.69
Changelog: <https://github.com/npm/cli/releases/tag/v123.420.69>
Run \`npm install -g npm@123.420.69\` to update!
Run \`npm install --location=global npm@123.420.69\` to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > color 1`] = `

New minor version of npm available! 123.419.69 -> 123.420.69
Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
Run npm install -g npm@123.420.69 to update!
Run npm install --location=global npm@123.420.69 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations minor to current > no color 1`] = `

New minor version of npm available! 123.419.69 -> 123.420.69
Changelog: <https://github.com/npm/cli/releases/tag/v123.420.69>
Run \`npm install -g npm@123.420.69\` to update!
Run \`npm install --location=global npm@123.420.69\` to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > color 1`] = `

New minor version of npm available! 123.420.70 -> 123.421.70
Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
Run npm install -g npm@123.421.70 to update!
Run npm install --location=global npm@123.421.70 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations minor to next version > no color 1`] = `

New minor version of npm available! 123.420.70 -> 123.421.70
Changelog: <https://github.com/npm/cli/releases/tag/v123.421.70>
Run \`npm install -g npm@123.421.70\` to update!
Run \`npm install --location=global npm@123.421.70\` to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > color 1`] = `

New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
Changelog: https://github.com/npm/cli/releases/tag/v124.0.0-beta.99999
Run npm install -g npm@124.0.0-beta.99999 to update!
Run npm install --location=global npm@124.0.0-beta.99999 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations new beta available > no color 1`] = `

New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999
Changelog: <https://github.com/npm/cli/releases/tag/v124.0.0-beta.99999>
Run \`npm install -g npm@124.0.0-beta.99999\` to update!
Run \`npm install --location=global npm@124.0.0-beta.99999\` to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > color 1`] = `

New patch version of npm available! 123.420.68 -> 123.420.69
Changelog: https://github.com/npm/cli/releases/tag/v123.420.69
Run npm install -g npm@123.420.69 to update!
Run npm install --location=global npm@123.420.69 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations patch to current > no color 1`] = `

New patch version of npm available! 123.420.68 -> 123.420.69
Changelog: <https://github.com/npm/cli/releases/tag/v123.420.69>
Run \`npm install -g npm@123.420.69\` to update!
Run \`npm install --location=global npm@123.420.69\` to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > color 1`] = `

New patch version of npm available! 123.421.69 -> 123.421.70
Changelog: https://github.com/npm/cli/releases/tag/v123.421.70
Run npm install -g npm@123.421.70 to update!
Run npm install --location=global npm@123.421.70 to update!

`

exports[`test/lib/utils/update-notifier.js TAP notification situations patch to next version > no color 1`] = `

New patch version of npm available! 123.421.69 -> 123.421.70
Changelog: <https://github.com/npm/cli/releases/tag/v123.421.70>
Run \`npm install -g npm@123.421.70\` to update!
Run \`npm install --location=global npm@123.421.70\` to update!

`