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.
相关文章