npm install give Error: EPERM, unlink

前端 未结 8 2265
攒了一身酷
攒了一身酷 2020-12-06 01:16

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 tri

相关标签:
8条回答
  • 2020-12-06 01:34

    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.

    0 讨论(0)
  • 2020-12-06 01:37

    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.

    0 讨论(0)
  • 2020-12-06 01:38

    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.

    0 讨论(0)
  • 2020-12-06 01:40

    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

    • run npm i again worked
    0 讨论(0)
  • 2020-12-06 01:46

    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.

    0 讨论(0)
  • 2020-12-06 01:48

    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.

    0 讨论(0)
提交回复
热议问题