14

yarn install throws:

EACCES: permission denied, unlink '/home/minnak/Darbas/market/node_modules/.yarn-integrity'

Might be related to this issue

I tried checking for permissions:

ls -la /home/minnak/Darbas/market/node_modules/.yarn*

Output: -rw-r--r-- 1 root root 490276 kov. 13 15:10 /home/minnak/Darbas/market/node_modules/.yarn-integrity

and then:

sudo chown -R minnak /home/minnak/.config/yarn/

Then launch yarn install again and get the same error.

tk421
  • 5,557
  • 6
  • 23
  • 33
Mindaugas
  • 195
  • 1
  • 1
  • 8

2 Answers2

14

Try running sudo rm -rf /home/minnak/Darbas/market/node_modules/ and then yarn without elevated permissions.

Matas
  • 174
  • 1
  • 3
  • 1
    This works but I keep having to do it a lot. I have 3 projects in my workspace and I have to do it for each one all the time. – Batman Jun 09 '20 at 04:33
  • I did something similar but less destructive, from the project folder: `sudo chown -R $USER:$GROUP node_modules` – Akronix Apr 25 '22 at 08:31
13

It's likely a unix permission related problem. There is a solution posted on the dev's github page. Try to run the following command

sudo chown -R $USER:$GROUP ~/.npm
sudo chown -R $USER:$GROUP ~/.config

Reference: EACCES: permission denied .config/configstore/bower-github.json #2262

Muhammad Numan
  • 17,689
  • 4
  • 42
  • 65