close

[Solved] npm – EPERM: operation not permitted on Windows

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error npm – EPERM: operation not permitted on Windows in javascript. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How npm – EPERM: operation not permitted on Windows Error Occurs?

Today I get the following error npm – EPERM: operation not permitted on Windows in javascript.

How To Solve npm – EPERM: operation not permitted on Windows Error ?

  1. How To Solve npm – EPERM: operation not permitted on Windows Error ?

    To Solve npm – EPERM: operation not permitted on Windows Error This is occurring because windows is not giving permission to the user to create a folder inside system drive. To solve this:
    Right Click
    The Folder > Properties > Security Tab
    Click on Edit to change Permissions > Select the user and give Full Control to that user.

  2. npm – EPERM: operation not permitted on Windows

    To Solve npm – EPERM: operation not permitted on Windows Error This is occurring because windows is not giving permission to the user to create a folder inside system drive. To solve this:
    Right Click
    The Folder > Properties > Security Tab
    Click on Edit to change Permissions > Select the user and give Full Control to that user.

Solution 1

Running this command was my mistake.

npm config set prefix /usr/local

Path /usr/local is not for windows. This command changed the prefix variable at 'C:\Program Files (x86)\Git\local'

To access and make a change to this directory I need to run my cmd as administrator.

So I did:

  1. Run cmd as administrator
  2. Run npm config edit (You will get notepad editor)
  3. Change prefix variable to C:\Users\<User Name>\AppData\Roaming\npm

Then npm start works in a normal console.

Solution 2

This is occurring because windows is not giving permission to the user to create a folder inside system drive. To solve this:

Right Click

The Folder > Properties > Security Tab

Click on Edit to change Permissions > Select the user and give Full Control to that user.

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also Read

Leave a Comment