I ran
npm config set prefix /usr/local
After running that command, When trying to run any npm commands on Windows OS I keep getting the below.
Error: EPERM: operation not permitted, mkdir 'C:\Program Files (x86)\Git\local'
at Error (native)
Have deleted all files from
C:\Users\<your username>\.config\configstore\
It did not work.
Any suggestion ?
Sometimes, all that's required is to stop the dev server before installing/updating packages.
I updated my node version to 8.9.4 and ran the necessary install command again from administrator command prompt. It worked for me!
Simplest way
Hope I am not too late for this post but recently even I too got hit by this issue. And also I had no admin rights on my laptop.
Here is the simplest way I fixed the bug.
.npmrc
(it will be inC:\Users\<user name>\.npmrc
)prefix=
toprefix=C:\Users\<user name>\AppData\Roaming\npm
hope it will be helpful..
I use Windows 10. I started the CMD as administrator, and it solved the problem.
Find CMD, right click, and click open as administrator.
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.
A reboot of my laptop and then
npm install
worked for me!