Skip to content
Merged
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
6 changes: 5 additions & 1 deletion lib/utils/error-message.js
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
8 changes: 4 additions & 4 deletions tap-snapshots/test/lib/utils/error-message.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down Expand Up @@ -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",
Expand Down
Loading