Npm install gives an error: EPERM, unlink

using the npm install command, run the following error:

Error: EPERM, unlink

System Information: Bower Version: 1.3.12 Node Version: 0.10.35 OS: Windows8

I tried a workaround but nothing worked.

  • clear cache
  • remove bower
  • Unpacking zip with npm
  • reinstall the gazebo

It didn’t work for me, please offer me some solution

+12
source share
7 answers

I got this problem yes on Windows 10.

Decision?

Disable content indexing for this folder (the one that contains package.json) !!

In the Windows Shell (file manager), do the following:

  1. Right-click the folder with the error, select "Properties"
  2. Click the "Advanced ..." button.
  3. Uncheck "Allow indexing the contents of files in this folder in addition to file properties."
  4. Click OK.
  5. In the previous Properties dialog box (displayed again), click Apply.
  6. Select the "Apply changes to this folder, subfolder and files" radio button.
  7. Click OK.
  8. (may take some time)
  9. Click OK (to close the properties dialog).
  10. Works!

Screenshot of the infamous checkbox

+8
source

In my case, these were permissions - perhaps in the node_modules tree, but to be sure, I gave myself ownership and rights to the entire project tree, which fixed the problem.

Right-click your project’s folder, select Properties, then the Security tab and click the Advanced button. Establish yourself as an owner and give yourself full rights. Check the box "Replace all permissions of child objects ..." and OK.

Advanced Security Settings Dialog Box

+1
source

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

+1
source

You do not have the rights necessary to delete this file. Somehow you got npm / bower to perform actions that conflict with the default Windows permissions system.

It would probably be easier to remove bower and npm and reinstall them, and then upgrade 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 the CMD window (you may need to run it as an Administrator):

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

This provides Everyone Full Control in your temporary directory, which potentially poses a security risk. However, this should allow npm and bower clear old files.

I recommend you try reinstalling node , npm and bower .

0
source

For me, deleting indexing solved my problem.

But indexing returned after having to re-create the folder. In this case, the solution is one of the following options:

  • permanently disable indexing service or
  • exclude indexing folder or
  • exclude file format in indexing parameter.

I am on Windows 10, and this action seems to solve my problem forever.

0
source

There was a similar problem - npm install worked for months, but we updated several libraries and started getting the same error.

The switch from NPM to yarn ended, which worked.

0
source

I got the same error and it was resolved using the correct node version for npm. Check your package.json 'engine' and the version of the installed node. You can use the Node version manager if you need to install multiple versions and switch between them: https://github.com/coreybutler/nvm-windows/releases

0
source

Source: https://habr.com/ru/post/1210684/


All Articles