Skip to content
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

Ensure package exists when checking tags #331

Merged
merged 8 commits into from
Jan 22, 2019

Conversation

jajaperson
Copy link
Contributor

@jajaperson jajaperson commented Jan 19, 2019

Fixes #179

Copy link
Collaborator

@fregante fregante left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should probably verify that the error contains is not in the npm registry. so it doesn't hide all errors

@jajaperson
Copy link
Contributor Author

jajaperson commented Jan 19, 2019

@bfred-it Okay, I'll do that.

@jajaperson
Copy link
Contributor Author

🤦‍♂️ okay should work now.

source/npm-util.js Outdated Show resolved Hide resolved
Co-Authored-By: jajaperson <jamesarthurjensen@gmail.com>
@sindresorhus
Copy link
Owner

The output of the command on error is:

{
  "error": {
    "code": "E404",
    "summary": "'sdfsdfagsdagag' is not in the npm registry.\nYou should bug the author to publish it\n(or use the name yourself!)\n\nNote that you can also install from a\ntarball, folder, http url, or git url.",
    "detail": "\n 'sdfsdfagsdagag@latest' is not in the npm registry.\nYour package name is not valid, because \n 1. name can only contain URL-friendly characters\n\nNote that you can also install from a\ntarball, folder, http url, or git url."
  }
}

I think it would be better to just check the code property instead on relying on the error summary being stable.

@sindresorhus
Copy link
Owner

@jajaperson Please write a descriptive PR title.

@jajaperson jajaperson changed the title Fix #179 Ensure package exists when checking tags Jan 22, 2019
@jajaperson
Copy link
Contributor Author

*bfred-it

@sindresorhus sindresorhus merged commit 94e31f3 into sindresorhus:master Jan 22, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants