npm install give Error: EPERM, unlink
Asked Answered
G

8

18

using command npm install give the following error

Error: EPERM, unlink

System info: Bower version: 1.3.12 Node version: 0.10.35 OS : Windows8

I tried below workaround but nothing is worked out.

  1. clean bower cache
  2. uninstall bower
  3. Update decompress-zip using npm
  4. install the bower again

Its not worked for me please suggest me some solution

Gunthar answered 8/1, 2015 at 16:44 Comment(3)
I am facing this issue while unpacking the livereload plugin through bowerGunthar
Error: EPERM, unlink 'C:\Users\path\Temp\HOME-SYS-10\bower\liver eload-3824-f2JJ7k\archive.tar.gz'Gunthar
Do you have any new?? I have the same problem and I have opened an issue in Bower github : github.com/bower/bower/issues/1710Charil
M
21

I got this problem, yes in Windows 10.

Solution?

To disable indexing of contents for that folder (the one containing the package.json)!!

On Windows Shell (File Manager), follow this steps:

  1. Right click on the folder with the error, choose 'Properties'
  2. Click the 'Advanced...' button.
  3. Uncheck the checkbox 'Allow files in this folder to have contents indexed in addition to file properties'.
  4. Press 'OK'.
  5. On the previous Properties dialog (visible again), press 'Apply'
  6. Check radio button 'Apply changes to this folder, subfolder and files'.
  7. Press 'OK'.
  8. (can take a while)
  9. Press 'OK' (to close properties dialog).
  10. Works!

Screenshot of the infamous checkbox

Machicolation answered 28/6, 2018 at 23:42 Comment(1)
Sorry to hear that, no idea what could be, have a look at the other responses (the fix I mention works if the HDD activity is close to 100%).Machicolation
B
4

In my case, it was permissions - probably in the node_modules tree, but just to be sure, I granted myself ownership and rights to the entire project tree which fixed the problem.

Right click on your project folder, select Properties, then the Security tab and click the Advanced button. Set yourself as the owner and grant yourself full permissions. Check "Replace all child object permission..." and OK.

Advanced Security Settings Dialog Box

Bassett answered 28/2, 2019 at 21:55 Comment(0)
H
2

My case was even simpler... a process was still using one of the files in the folder that required deletion. Killing the task responsible enabled me to install correctly.

Hormone answered 6/8, 2019 at 13:46 Comment(0)
P
0

You don't have the permissions necessary to remove that file. Somehow you have caused npm/bower to do things that conflict with the default windows permission system.

It would probably be simplest to remove bower and npm and reinstall them, and then update your npm to the latest version following the instructions here https://github.com/npm/npm/wiki/Troubleshooting

For a quick fix that might help, try this in a CMD window (you may need to start it as Administrator):

 cd C:\users\path\temp
 cacls . /T /E /C /G Everyone:F

That grants Everyone Full Control over your temp directory, which is potentially a security risk. However, it should make it possible for npm and bower to clean up old files.

I recommend you try reinstalling node, npm, and bower.

Pericynthion answered 8/1, 2015 at 18:23 Comment(0)
B
0

For me, remove the indexation has solved my problem.

But the indexation was back after to have recreate the folder. In this case the solution is one the options follow:

  • disable permanently the indexation service or
  • exclude the folder of indexation or
  • exclude the file format in indexation option.

I am on Windows 10 and this action seems resolve my problem permanently.

Breena answered 13/6, 2019 at 20:13 Comment(0)
B
0

Had a similar issue - npm install had worked fine for months, but we upgraded a few libraries and started getting the same error.

Ended up switching from NPM to yarn, which did work.

Backsheesh answered 15/8, 2019 at 9:31 Comment(0)
F
0

I got the same error and it has been solved by using correct version of node for npm. Check your package.json 'engines' and your installed node version. You can use Node version manager if you need to have several versions installed and switch between them: https://github.com/coreybutler/nvm-windows/releases

Fur answered 20/9, 2019 at 10:17 Comment(0)
K
0

What I tried

  • delete node_modules folder
  • delete package-lock.json
  • run npm clear cache --force
  • undo if the files in the folder are read-only

enter image description here

  • run npm i again worked
Katy answered 28/8, 2020 at 12:30 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.