15

I am getting an error while running npm install for a react application:

An unexpected error occurred: "EACCES: permission denied, unlink '/home/ats/react-app/myapp/node_modules/@babel/helper-module-imports/LICENSE'".

Can someone help me sort this error out?

Willi Mentzel
  • 27,862
  • 20
  • 113
  • 121
Abdulla Thanseeh
  • 9,438
  • 3
  • 11
  • 17

3 Answers3

35

I had the same problem and I solved it like this:

  • Remove node_modules folder of your project manually.

  • Then yarn install or npm install.

סטנלי גרונן
  • 2,917
  • 23
  • 46
  • 68
reza makhdomi
  • 519
  • 4
  • 6
5

Try changing the folder permissions to have the correct ones. If you consider there is no drawback to have the folder with full permissions this command should solve your problem:

sudo chmod -R 777 folderName
Leo
  • 712
  • 8
  • 10
0

Execute as sudo if you are using Linux.

  • This does not provide an answer to the question. Once you have sufficient [reputation](https://stackoverflow.com/help/whats-reputation) you will be able to [comment on any post](https://stackoverflow.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/31449041) – pitamer Apr 06 '22 at 07:00
  • 1
    On top of that, this is NOT a good thing to go unfortunately. – kissu Jul 22 '22 at 18:41