summaryrefslogtreecommitdiff
path: root/deps/npm/lib/utils/error-message.js
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/lib/utils/error-message.js')
-rw-r--r--deps/npm/lib/utils/error-message.js4
1 files changed, 3 insertions, 1 deletions
diff --git a/deps/npm/lib/utils/error-message.js b/deps/npm/lib/utils/error-message.js
index 55c5463454..bf5d65c0df 100644
--- a/deps/npm/lib/utils/error-message.js
+++ b/deps/npm/lib/utils/error-message.js
@@ -154,10 +154,12 @@ function errorMessage (er) {
var msg = er.message.replace(/^404\s+/, '')
short.push(['404', msg])
if (er.pkgid && er.pkgid !== '-') {
+ var pkg = er.pkgid.replace(/(?!^)@.*$/, '')
+
detail.push(['404', ''])
detail.push(['404', '', "'" + er.pkgid + "' is not in the npm registry."])
- var valResult = nameValidator(er.pkgid)
+ var valResult = nameValidator(pkg)
if (valResult.validForNewPackages) {
detail.push(['404', 'You should bug the author to publish it (or use the name yourself!)'])