-
Notifications
You must be signed in to change notification settings - Fork 3.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: wrong npm doctor
command result
#1416
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.
hi @vanishcode thanks for the contribution 😊 this looks like a good fix! we would need some unit tests that could help us reproduce the error and that we can use it to validate the fix solves it - you can take a look at https://github.com/npm/cli/blob/latest/test/tap/doctor.js for reference (and that would also be the perfect place to add a new test).
ok, I will add unit test for this fix later. thank you! @ruyadorno |
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.
Thanks! This looks great 😄
Detail
when I run
npm doctor
, I found that the some infomation in the result table were totaly wrong, look the screenshot:look at the
Recommendation
columnthe right result:
I found that if I changed the default registry to another url (such as https://registry.npm.taobao.org), and
ping
returns error, it would happend.so i checked and modified the
check-ping.js
, whenping
is failed, returncb(null, [err.code.substr(1), 'failed'])
instead ofcb(null, [err.code.substr(1)])
i don't know if it's a bug certainty, if it's realy not, i'll close this pr.
(forgive me that English is not my mother language······)
Environment
macOS 10.15.5
node 10.18.0
npm 6.14.5 (from source code)