buf icon indicating copy to clipboard operation
buf copied to clipboard

Cannot install typescript dependencies with yarn

Open inceenes10 opened this issue 2 years ago • 5 comments

Hi, I am learning buf package manager for a few days and practicing it with nestjs. I have a problem with it.

If I use npm install @buf/openfga_api.grpc_node, package is installed successfully, but with yarn yarn add @buf/openfga_api.grpc_node it gives an error like this

error An unexpected error occurred: "The first argument must be of type string or an instance of Buffer, ArrayBuffer, or Array or an Array-like Object. Received undefined".

I don't understand the error. Help, please.

inceenes10 avatar Jan 09 '23 09:01 inceenes10

Hi Enes, thanks for the report. The error message from yarn really isn't ideal helpful. From our documentation:

Please be aware that Yarn versions greater than v1.10.0 and less than v2 are not supported. These versions of Yarn require the shasum field in the dist object to be set, but the BSR can't compute a digest without generating the code for all possible versions of the package.

We are currently looking into removing this limitation. In the meantime, is it an option for you to switch to a newer version?

timostamm avatar Jan 09 '23 10:01 timostamm

Do I have the option to contribute, but I don't really know where to start?

inceenes10 avatar Jan 09 '23 10:01 inceenes10

Thanks for the initiative, Enes! The code for the NPM registry implementation that runs Remote Packages is part of the BSR, which is closed source. It is definitely possible that the BSR will be open source in the future, but it is not currently planned. So we unfortunately cannot accept contributions right now.

Yarn berry makes some very opinionated choices that not everybody might agree with, but staying at v1 doesn't seem to be a great option either, judging from the maintainers note on GitHub:

If you hit bugs or issues with Yarn 1.x, we strongly suggest you migrate to the latest release - at this point they have been maintained longer than 1.x, and many classes of problems have already been addressed there.

timostamm avatar Jan 10 '23 12:01 timostamm

@timostamm is there anything for us to do here?

bufdev avatar Mar 09 '23 01:03 bufdev

@bufdev, we're working on a feature that allows us to provide a hash for the package, which will make yarn v1 work.

Makes sense to me to wait for this feature to land, and close this issue as fixed then, so that users looking at this issue will know.

timostamm avatar Mar 09 '23 12:03 timostamm