19

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,775
  • 6
  • 23
  • 34
Mindaugas
  • 375
  • 1
  • 3
  • 8

1 Answers1

23

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

Matas
  • 264
  • 2
  • 3
  • 2
    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
  • 6
    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