yarn
yarn copied to clipboard
v1.22.0: package with hard link fails to install
Bug description
Command
yarn add lz4
What is the current behavior?
As of version 1.22.0, yarn is unable to install this package on Linux environments (though it seems to work as expected on Windows). It fails with the following error:
error https://registry.yarnpkg.com/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 '/usr/local/share/.cache/yarn/v6/npm-lz4-0.6.3-78df6bb69a36d7db6c2e849494876ba6e38e66d6-integrity/node_modules/lz4/build/Release/obj.target/build/Release/lz4.node' -> '/usr/local/share/.cache/yarn/v6/npm-lz4-0.6.3-78df6bb69a36d7db6c2e849494876ba6e38e66d6-integrity/node_modules/lz4/build/Release/obj.target/lz4.node'"
What is the expected behavior?
The package should install successfully. I'm not sure if this is an issue with yarn or with the node-lz4 package, but it works using npm or earlier versions of yarn. Perhaps this is related to 0e7133ca28618513503b4e1d9063f1c18ea318e5?
Environment
- Node Version:
13.8.0 - Yarn v1 Version:
1.22.0 - OS and version:
Ubuntu 18.04.3 LTS
We are having this issue as well, see https://travis-ci.com/terascope/file-assets/jobs/284662598
Also happening with:
- node v10.19.0
- yarn 1.22.0
- macOS 10.15.4 Beta
error https://codeload.github.com/tradle/react-native-http/tar.gz/834492dbc792b1dec8ec8f0a1c9671f640339f01: Extracting tar content of undefined failed, the file appears to be corrupt: "EINVAL: invalid argument, symlink '' -> '/Users/rajiv/Library/Caches/Yarn/v6/npm-react-native-http-1.0.0/node_modules/react-native-http/example/get/node_modules/http-browserify'"
This might be a related issue. Since yarn version 1.22.0 the following is not installed correctly.
$ yarn add moment/moment#^2.23.0
$ ls -l node_modules/moment/meteor/
total 32
-rw-rw-r-- 1 mmanashirov staff 180 Mar 5 17:25 README.md
-rw-rw-r-- 1 mmanashirov staff 188 Mar 5 17:25 export.js
lrwxrwxr-x 1 mmanashirov staff 9 Mar 5 17:25 moment.js -> moment.js
-rw-rw-r-- 1 mmanashirov staff 653 Mar 5 17:25 package.js
-rw-rw-r-- 1 mmanashirov staff 136 Mar 5 17:25 test.js
Notice the file moment.js -> moment.js is a symlink to itself. Prior versions of yarn correctly created the symlink to be moment.js -> ../moment.js.
@mmanashirov indeed downgrading has helped.
yarn policies set-version 1.19.2
Hey just checking in to see if there is any update on this issue.
Locking to an older version is a pretty big hassle for our team. We keep getting service requests from other people that use our library because they think our library, when it's really an underlying package we use that relies on lz4.
@apski you saved my life