diff --git a/AUTHORS b/AUTHORS index fb7d537fd4d29..ce701aa952ce6 100644 --- a/AUTHORS +++ b/AUTHORS @@ -847,3 +847,4 @@ Patryk Ludwikowski Takuya N Neel Dani Anton Rieder <1301152+aried3r@users.noreply.github.com> +Dimitri Masson <5263585+dhmmasson@users.noreply.github.com> \ No newline at end of file diff --git a/lib/utils/update-notifier.js b/lib/utils/update-notifier.js index 75e944407ffbd..89a37bd3519ed 100644 --- a/lib/utils/update-notifier.js +++ b/lib/utils/update-notifier.js @@ -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` + diff --git a/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs b/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs index 157390997d793..726e07c2830d8 100644 --- a/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs +++ b/tap-snapshots/test/lib/utils/update-notifier.js.test.cjs @@ -9,7 +9,7 @@ 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! ` @@ -17,7 +17,7 @@ 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: -Run \`npm install -g npm@123.420.69\` to update! +Run \`npm install --location=global npm@123.420.69\` to update! ` @@ -25,7 +25,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations minor to 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! ` @@ -33,7 +33,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations minor to New minor version of npm available! 123.419.69 -> 123.420.69 Changelog: -Run \`npm install -g npm@123.420.69\` to update! +Run \`npm install --location=global npm@123.420.69\` to update! ` @@ -41,7 +41,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations minor to 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! ` @@ -49,7 +49,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations minor to New minor version of npm available! 123.420.70 -> 123.421.70 Changelog: -Run \`npm install -g npm@123.421.70\` to update! +Run \`npm install --location=global npm@123.421.70\` to update! ` @@ -57,7 +57,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations new beta 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! ` @@ -65,7 +65,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations new beta New prerelease version of npm available! 124.0.0-beta.0 -> 124.0.0-beta.99999 Changelog: -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! ` @@ -73,7 +73,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations patch to 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! ` @@ -81,7 +81,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations patch to New patch version of npm available! 123.420.68 -> 123.420.69 Changelog: -Run \`npm install -g npm@123.420.69\` to update! +Run \`npm install --location=global npm@123.420.69\` to update! ` @@ -89,7 +89,7 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations patch to 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! ` @@ -97,6 +97,6 @@ exports[`test/lib/utils/update-notifier.js TAP notification situations patch to New patch version of npm available! 123.421.69 -> 123.421.70 Changelog: -Run \`npm install -g npm@123.421.70\` to update! +Run \`npm install --location=global npm@123.421.70\` to update! `