antfu / antfu/node-modules-inspector
Handle private package npm metadata fetching failures better
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 90
- Avg merge
- 2d 3h
- Merged PRs (30d)
- 9
Description
Clear and concise description of the problem
When fetching npm meta for private packages, it prints warnings like:
Failed to get npm meta for: [ 'undefined@undefined' ]
I know the private package's meta can't be fetched from the https://npm.antfu.dev/ endpoint, but it seems the error wasn't handled correctly.
Suggested solution
The result might be:
{
url: '/...',
statusCode: 500,
statusMessage: '',
message: '[GET] "https://registry.npmjs.org/some-private-package": 404 Not Found'
}
We could either handle this to improve the warning logs (insteas of undefined@undefined)
or fetch npm meta using current private registry URL (e.g., https://private-registry.com/some-private-package)
Alternative
No response
Additional context
I'm willing to submit a PR for this. 🙌🏻
Validations
- Follow our Code of Conduct
- Read the Contributing Guide.
- Check that there isn't already an issue that request the same feature to avoid creating a duplicate.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in packages/node-modules-inspector/src/shared/version-info.ts around lines 24–31 and reproduce the warning while fetching metadata for a private package. Determine whether the implementation should use the current private registry or improve the failed-fetch warning; done means the selected behavior no longer reports the package as undefined@undefined.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- nodejs, typescript
- Domain
- devtools
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100