npm - EPERM:Windows上不允许操作 [英] npm - EPERM: operation not permitted on Windows
本文介绍了npm - EPERM:Windows上不允许操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我跑了
npm config set prefix /usr/local
运行该命令后,
尝试在Windows操作系统上运行任何npm命令时,我会继续下面的操作。
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)
已删除所有文件
C:\Users\<your username>\.config\configstore\
它没有用。
有什么建议吗?
推荐答案
运行此命令是我的错误。
Running this command was my mistake.
npm config set prefix / usr / local
npm config set prefix /usr/local
路径 / usr / local
不适用于Windows。此命令更改了'前缀变量'C:\Program Files(x86)\ Git \ local'
Path /usr/local
is not for windows. This command changed the prefix variable at 'C:\Program Files (x86)\Git\local'
要访问并更改此目录,我需要以管理员身份运行我的cmd。
To access and make a change to this directory I need to run my cmd as administrator.
所以我做了:
- 以管理员身份运行cmd
- 运行
npm config edit
(您将获得记事本编辑器) - 更改
前缀
变量为C:\ Users \<用户名> \ AppData \Roaming\\\
pm
- Run cmd as administrator
- Run
npm config edit
(You will get notepad editor) - Change
Prefix
variable toC:\Users\<User Name>\AppData\Roaming\npm
然后 npm start
在普通控制台中运行。
Then npm start
works in a normal console.
这篇关于npm - EPERM:Windows上不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文