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

fix: npm alias parsing with complex version strings #1319

Merged
merged 1 commit into from
Aug 28, 2023

Conversation

Cherry
Copy link
Contributor

@Cherry Cherry commented Aug 25, 2023

parseGithubURL('npm:chalk@1.0.0') returns null, whereas parseGithubURL('npm:chalk@1.0.0-dasda.2') throws an error in Node 18.17+.

This would mean that dependencies like npm:postman-request@2.88.1-postman.33 would crash the process with an ERR_INVALID_URL error.

For details on the Node.js regression, see nodejs/node#49330. Given how url.parse is a deprecated stability-0 method though, it's very possible this won't be fixed. Thus handling it here with a try...catch might be the best solution.

Fixes #1318

@raineorshine
Copy link
Owner

Beautiful, thanks!

I'm on vacation without a computer this weekend, so I'll publish the patch on Monday.

@Cherry
Copy link
Contributor Author

Cherry commented Aug 25, 2023

Awesome, thank you! The failing tests seem to be unrelated to my changes.

@raineorshine raineorshine merged commit b7fec80 into raineorshine:main Aug 28, 2023
9 checks passed
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.

ERR_INVALID_URL with npm alias
2 participants