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

前端 未结 30 2369
囚心锁ツ
囚心锁ツ 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: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.

提交回复
热议问题