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
|
const result = await getLatestVersionBatch(queue, { metadata: true }) |
|
for (const r of result) { |
|
if (r.publishedAt) { |
|
onResult(r) |
|
} |
|
else { |
|
missingSpecs.add(`${r.name}@${r.version}`) |
|
} |
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
Clear and concise description of the problem
When fetching npm meta for private packages, it prints warnings like:
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
node-modules-inspector/packages/node-modules-inspector/src/shared/version-info.ts
Lines 24 to 31 in 2573b65
The result might be:
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