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

查看:46
本文介绍了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:

  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

Then npm start works in a normal console.

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

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