-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
error-message: strip version info from pkg on E404 #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can use t.match()
for better errors btw
I thought I had seen something like that before, I'll change it in a minute (trying out some tink stuff now). |
lib/utils/error-message.js
Outdated
detail.push(['404', '']) | ||
detail.push(['404', '', "'" + er.pkgid + "' is not in the npm registry."]) | ||
detail.push(['404', '', "'" + pkg + "' is not in the npm registry."]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Output should still include the version, because if I say npm i npm@20.0.0
I don't want an error saying that npm
isn't in the registry.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems I forgot to address this earlier, but I added a fix (not sure why I changed it in the first place).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seeing this makes me want to use template literals. =)
db63b89
to
b09bc8c
Compare
Keep the version number in the error message. See npm#132 (comment)
See https://npm.community/t/4227