[Bug?]: Error for packages without any versions #6630
Labels
bug
Something isn't working
waiting for feedback
Will autoclose in a while unless more data are provided
Self-service
Describe the bug
When running Yarn against a package that provides an empty
versions
object on the metadata, the following error is printed:This was reproduced with a custom registry, however other package managers like npm and pnpm do not run into errors with this. It seems reasonable to me that an empty versions object should be treated like a 404 on the endpoint, which gives essentially the same output just without the "ugly" backtrace and error.
The endpoint hit here specifically should be
https://registry.npmjs.org/typescript
, or its corresponding version with the private registry.To reproduce
It might be possible to reproduce this with a package that had versions completely unpublished, I'm not entirely sure to which degree that is possible with NPM.
The easiest way is likely to run it against a proxy where one has full control over the response. I'd imagine it should be easy to reproduce by just editing the response object in the code itself, even if that is not a "real world" reproduction of this bug.
If more detailed reproduction steps are necessary, please let me know. But I'd imagine this should be quite simple to fix if it is considered to be a bug with Yarn.
Environment
Additional context
No response
The text was updated successfully, but these errors were encountered: