Do you want to request a feature or report a bug?
This is a bug report. Maybe related to #961
What is the current behavior?
yarn install
fails while installing some packages with permission denied error.
error An unexpected error occurred: "EACCES: permission denied, unlink '/home/johannes/.cache/yarn/v1/npm-tsickle-0.25.5-2891d29f97c4aab1306e06378d8496d1765a4bfe/src/class_decorator_downlevel_transformer.d.ts'".
ll
in the src folder gives following result:
dr-xr-x--x 2 johannes johannes 4096 Nov 15 02:12 ./
drwxrwxr-x 3 johannes johannes 4096 Dez 15 13:15 ../
-r-xr-x--- 1 johannes johannes 301 Nov 15 02:12 class_decorator_downlevel_transformer.d.ts*
Deleting this folder befor yarn install
doesn't help.
If the current behavior is a bug, please provide the steps to reproduce.
Create a folder with the following package.json:
{
"name": "testtsickleyarn",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"tsickle": "^0.25.5"
}
}
Run yarn
What is the expected behavior?
The operation should succeed (as it does with npm install
),
Please mention your node.js, yarn and operating system version.
I tried it out on OSX but don't get an error
~/Projects/yarn-test ๐ cat package.json
{
"name": "testtsickleyarn",
"version": "1.0.0",
"description": "",
"main": "index.js",
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1"
},
"author": "",
"license": "ISC",
"dependencies": {
"tsickle": "^0.25.5"
}
}
~/Projects/yarn-test ๐ yarn
yarn install v1.3.2
info No lockfile found.
[1/4] ๐ Resolving packages...
[2/4] ๐ Fetching packages...
[3/4] ๐ Linking dependencies...
warning " > [email protected]" has unmet peer dependency "typescript@>=2.4.2 <2.6".
[4/4] ๐ Building fresh packages...
success Saved lockfile.
โจ Done in 0.68s.
~/Projects/yarn-test ๐ ls -l `yarn cache dir`/npm-tsickle-0.25.5-2891d29f97c4aab1306e06378d8496d1765a4bfe/src/
total 1944
-rwxr-xr-- 1 jvalore 891112136 301 Nov 14 20:12 class_decorator_downlevel_transformer.d.ts
-rwxr-xr-- 1 jvalore 891112136 22698 Nov 14 20:12 class_decorator_downlevel_transformer.js
...
It does look like #961 but that should have been fixed a long time ago.
From a quick search it looks like archives should be extracted with permissions set:
const untarStream = tarFs.extract(this.dest, {
strip: 1,
dmode: 0o755, // all dirs should be readable
fmode: 0o644, // all files should be readable
chown: false, // don't chown. just leave as it is
});
so I'm not sure why yours would be different. If you are willing to debug into it some, I think that the extraction of the archive should happen in
src/fetchers/git-fetcher.js
or
src/fetchers/tarball-fetcher.js
search for tarFs.extract(
reinstalling of yarn helped. So this issue can be closed.
^ Classic case of "it works for me" still open in my mind.
I solved this by updating yarn version from 0.x to 1.x ๐
Had same issue on macOS, solved it by reinstalling yarn
rm -rf /Users/mota/Library/Caches/Yarn/
brew uninstall yarn
brew update
brew install yarn
I have the same problem, but with:
rm -r node_modules
yarn cache clean
yarn install
it worked perfectly!
Had same issue on macOS, solved it by reinstalling yarn
rm -rf /Users/mota/Library/Caches/Yarn/ brew uninstall yarn brew update brew install yarn
After messing around with chmods for 2 hours, this one just worked like a charm. Thanks.
Most helpful comment
reinstalling of yarn helped. So this issue can be closed.