npm - EPERM: operation not permitted on Windows(npm - EPERM:在 Windows 上不允许操作)
问题描述
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)Gitlocal'
at Error (native)
Have deleted all files from
C:Users<your username>.configconfigstore
It did not work.
Any suggestion ?
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)Gitlocal'
To access and make a change to this directory I need to run my cmd as administrator.
So I did:
- Run cmd as administrator
- Run
npm config edit
(You will get notepad editor) - Change
prefix
variable toC:Users<User Name>AppDataRoaming pm
Then npm start
works in a normal console.
这篇关于npm - EPERM:在 Windows 上不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!