npm - EPERM:Windows 上不允许操作 [英] npm - EPERM: operation not permitted on Windows

查看:45
本文介绍了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)Gitlocal'
at Error (native)

已删除

C:Users<your username>.configconfigstore

它没有用.

有什么建议吗?

推荐答案

运行这个命令是我的错误.

Running this command was my mistake.

npm 配置设置前缀/usr/local

npm config set prefix /usr/local

Path /usr/local 不适用于 Windows.此命令更改了 'C:Program Files (x86)Gitlocal'

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

要访问并更改此目录,我需要以管理员身份运行我的 cmd.

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

所以我做到了:

  1. 以管理员身份运行cmd
  2. 运行npm config edit(你会得到记事本编辑器)
  3. prefix 变量更改为 C:UsersAppDataRoaming pm
  1. Run cmd as administrator
  2. Run npm config edit (You will get notepad editor)
  3. Change prefix variable to C:Users<User Name>AppDataRoaming pm

然后 npm start 在普通控制台中工作.

Then npm start works in a normal console.

这篇关于npm - EPERM:Windows 上不允许操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆