pierrec / node-lz4

LZ4 fast compression algorithm for NodeJS
MIT License
438 stars 98 forks source link

Npm package appears corrupt (Installing with yarn) #97

Open juancarlosllhL opened 4 years ago

juancarlosllhL commented 4 years ago

HI!, Lz4 can't be installed with yarn, the package appears corrupt

$ yarn add lz4

yarn add v1.22.4
[1/4] 🔍  Resolving packages...
[2/4] 🚚  Fetching packages...
error https://registry.npmjs.org/lz4/-/lz4-0.6.3.tgz: Extracting tar content of undefined failed, the file appears to be corrupt: "ENOENT: no such file or directory, link '/home/juancarlosllh/.cache/yarn/v6/npm-lz4-0.6.3-78df6bb69a36d7db6c2e849494876ba6e38e66d6-integrity/node_modules/lz4/build/Release/obj.target/build/Release/lz4.node' -> '/home/juancarlosllh/.cache/yarn/v6/npm-lz4-0.6.3-78df6bb69a36d7db6c2e849494876ba6e38e66d6-integrity/node_modules/lz4/build/Release/obj.target/lz4.node'"

It can be installed with npm.

saimonmoore commented 4 years ago

Same here. I opened a ticket with a downstream dependency (kafkajs-lz4) but it's the same issue:

https://github.com/indix/kafkajs-lz4/issues/3

leoparis89 commented 4 years ago

It's due to a breaking change in yarn v1.22. Running yarn policies set-version 1.21 fixed the problem for me.

paambaati commented 4 years ago

A stop-gap measure in the meantime can be pinning your lz4 versions to 0.6.0.

In your package.json, you can add —

"resolutions": {
    "lz4": "0.6.0"
}

Further reading about resolutions - https://classic.yarnpkg.com/en/docs/selective-version-resolutions/#toc-how-to-use-it (Note that this works on both npm and yarn).