fix: wrong npm doctor command result#1416
Closed
vanishcode wants to merge 3 commits intonpm:latestfrom
vanishcode:latest
Closed
fix: wrong npm doctor command result#1416vanishcode wants to merge 3 commits intonpm:latestfrom vanishcode:latest
npm doctor command result#1416vanishcode wants to merge 3 commits intonpm:latestfrom
vanishcode:latest
Conversation
ruyadorno
suggested changes
Jun 12, 2020
Contributor
ruyadorno
left a comment
There was a problem hiding this comment.
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).
Contributor
Author
|
ok, I will add unit test for this fix later. thank you! @ruyadorno |
ruyadorno
approved these changes
Jun 17, 2020
Contributor
ruyadorno
left a comment
There was a problem hiding this comment.
Thanks! This looks great 😄
This was referenced Mar 6, 2021
This was referenced Mar 14, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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
Recommendationcolumnthe right result:
I found that if I changed the default registry to another url (such as https://registry.npm.taobao.org), and
pingreturns error, it would happend.so i checked and modified the
check-ping.js, whenpingis 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)