node-lz4 icon indicating copy to clipboard operation
node-lz4 copied to clipboard

Npm package appears corrupt (Installing with yarn)

Open juancarlosllhL opened this issue 5 years ago • 3 comments

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.

juancarlosllhL avatar Jun 09 '20 08:06 juancarlosllhL

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

saimonmoore avatar Jun 16 '20 04:06 saimonmoore

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

leoparis89 avatar Jul 15 '20 15:07 leoparis89

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).

paambaati avatar Jul 23 '20 06:07 paambaati