diff --git a/lib/utils/error-message.js b/lib/utils/error-message.js index 4b5582ac8e181..4fc14c92c17a9 100644 --- a/lib/utils/error-message.js +++ b/lib/utils/error-message.js @@ -165,7 +165,11 @@ const errorMessage = (er, npm) => { const pkg = er.pkgid.replace(/(?!^)@.*$/, '') detail.push(['404', '']) - detail.push(['404', '', `'${replaceInfo(er.pkgid)}' is not in this registry.`]) + detail.push([ + '404', + '', + `The requested resource '${replaceInfo(er.pkgid)}' could not be found or you do not have permission to access it.`, + ]) const nameValidator = require('validate-npm-package-name') const valResult = nameValidator(pkg) diff --git a/tap-snapshots/test/lib/utils/error-message.js.test.cjs b/tap-snapshots/test/lib/utils/error-message.js.test.cjs index 4cfd91fd278cd..42857b7be36ab 100644 --- a/tap-snapshots/test/lib/utils/error-message.js.test.cjs +++ b/tap-snapshots/test/lib/utils/error-message.js.test.cjs @@ -15,7 +15,7 @@ Object { Array [ "404", "", - "'http://evil:***@npmjs.org/not-found' is not in this registry.", + "The requested resource 'http://evil:***@npmjs.org/not-found' could not be found or you do not have permission to access it.", ], Array [ "404", @@ -58,7 +58,7 @@ Object { Array [ "404", "", - "'node_modules' is not in this registry.", + "The requested resource 'node_modules' could not be found or you do not have permission to access it.", ], Array [ "404", @@ -101,7 +101,7 @@ Object { Array [ "404", "", - "'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' is not in this registry.", + "The requested resource 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' could not be found or you do not have permission to access it.", ], Array [ "404", @@ -156,7 +156,7 @@ Object { Array [ "404", "", - "'yolo' is not in this registry.", + "The requested resource 'yolo' could not be found or you do not have permission to access it.", ], Array [ "404",