Error: EPERM: operation not permitted, unlink 'D:\Sources\**\node_modules\fsevents\node_modules\abbrev\package.json'

前端 未结 30 2287
囚心锁ツ
囚心锁ツ 2020-12-05 04:00

I just updated npm to 5.4.0.
Now, Whenever I want install a npm package I get the following error:

D:\\Sources\\DownloadCms\\Md         


        
相关标签:
30条回答
  • 2020-12-05 04:19

    Mine was as a result of opening my project folder a 2 different terminals. I solved it by closing all running terminal (vs code was excluded) and executing the installation command again.

    I hope this helps someone.

    NB: deleting node_modules didn't solve it.

    0 讨论(0)
  • 2020-12-05 04:19

    My problem was executing the command (npm audit fix all). I solved it when closing VSCODE and re-executed the command without problems.

    0 讨论(0)
  • 2020-12-05 04:20

    I wanted to run npm install from within my external hard drive as this is where i saved my code workspace. Windows 10 OS.

    But I was getting the same error as the original post.None of the previous answers worked for me, I tried all of them:

    1. uninstalling nodejs then re-installing
    2. uninstalling nodejs then downgrading/installing a lower version of nodejs.
    3. npm install -force
    4. deleting the folders from C:\Users{YourUsername}\AppData\Roaming ... npm and npm-cache then re-installing.
    5. npm cache clean --force
    6. npm cache clean
    7. npm install --g or npm install --global

    What worked for me was this:

    1. copy the folder from C:\Program Files\nodejs to D:\Program Files\nodejs
    2. Then go to Control Panel\System and Security\System
    3. Advanced System Settings
    4. Environment Variables
    5. System Variables
    6. Double click Path
    7. Add a new path
    8. D:\Program Files\nodejs
    9. Click ok
    10. restart PC.
    11. try npm install from within D: Drive
    0 讨论(0)
  • 2020-12-05 04:22
    the same error comes to me when i update the npm version to the latest 5.4 downgrade to the version 5.3.0 is useful.the error comes from the npm 5.4,you can check it in the issuses in npm 5.4
    npm install npm@5.3 -g
    
    0 讨论(0)
  • 2020-12-05 04:25

    I had the same problem on Windows.

    The source of the problem is simple, it is access permission on folders and files.

    In your project folder, you need

    1. After cloning the project, change the properties of the folder and change the permissions of the user (give full access to the current user).
    2. Remove the read-only option from the project folder. (Steps 1 and 2 take a long time because they are replicated to the entire tree below).
    3. Inside the project folder, reinstall the node (npm install reinstall -g)
    4. Disable Antivirus. (optional)
    5. Disable Firewall. (optional)
    6. Restart PC.
    7. Clear the npm cache (npm clear)
    8. Install the dependencies of your project (npm install)

    After that, error "Error: EPERM: operation not permitted, unlink" will no longer be displayed.

    Remember to reactivate the firewall and antivirus if necessary.

    0 讨论(0)
  • 2020-12-05 04:28

    Please close all IDE like visual studio code. run npm install command through node.js command prompt. Enjoy !

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