Npm安装角度/ cli错误EPERM不允许操作

时间:2018-10-31 15:48:18

标签: node.js angular-cli

  

4399错误错误:EPERM:不允许操作,取消链接   'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules.staging \ tmp-5fcc012e \ README.md'   4399错误{错误:EPERM:不允许操作,取消链接   'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules.staging \ tmp-5fcc012e \ README.md'   4399错误原因:4399错误{错误:EPERM:操作不正确   允许,取消链接   'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules.staging \ tmp-5fcc012e \ README.md'   4399错误errno:-4048,4399错误代码:'EPERM',4399   错误系统调用:“ unlink”,4399错误路径:   'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules \ .staging \ tmp-5fcc012e \ README.md'   },4399错误堆栈:“错误:EPERM:不允许操作,请取消链接   \'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules \ .staging \ tmp-5fcc012e \ README.md \'',   4399错误errno:-4048,4399错误代码:'EPERM',4399错误
  syscall:'unlink',4399错误路径:   'C:\ Users \ deven \ AppData \ Roaming \ npm \ node_modules \ .staging \ tmp-5fcc012e \ README.md',   4399错误的父代:“ @ angular / cli”} 4400错误的操作是   被您的操作系统拒绝。 4400错误可能是   文件已在使用中(通过文本编辑器或防病毒软件),4400错误或   您没有访问权限。 4400错误4400错误如果您   认为这可能是权限问题,请仔细检查   该文件及其包含目录的4400错误权限,或者   尝试再次以root / Administrator身份运行4400错误命令(尽管   不建议这样做)。 4401详细出口[-4048,true]

8 个答案:

答案 0 :(得分:2)

由于您正在使用Windows,因此必须启动终端 as administrator ,然后重试即可。

答案 1 :(得分:0)

这似乎是npm的问题。尝试删除您的node_modules文件夹,然后再次运行npm install。这应该可以解决问题。

答案 2 :(得分:0)

您的package.json可能在某些编辑器中打开了。关闭它,然后再次运行npm命令。

答案 3 :(得分:0)

尝试使用以下方法卸载CLI:

npm uninstall -g @angular/cli

并使用以下命令重新安装:

npm install -g @angular/cli

并尝试将npm更新到最新版本

npm cache clean --force

npm install -g npm@latest

答案 4 :(得分:0)

  1. 以管理员身份启动代码编辑器(例如Visual Studio Code)。
  2. npm install -g @ vue / cli。
  3. 可以创建您的项目名称。

答案 5 :(得分:0)

请尝试以下步骤:

  1. 删除node_modules
  2. 执行npm缓存清理--force
  3. 重新启动电脑
  4. 再试一次 npm install ,现在将安装模块而没有任何问题

(可选)-如果您在VPN后面并且未使用任何私有注册表,请退出VPN并在重新启动pc后执行 npm install

答案 6 :(得分:0)

当我这样做时,它为我解决了:右键单击 -我使用的任何程序-并选择以管理员身份运行。 我个人是在 PowerShell 上制作的,但我认为它可以在任何程序上以这种方式工作

答案 7 :(得分:-1)

我在多个终端中打开了该项目。稍后关闭所有相应的终端并运行“npm i”后,一切开始运行良好。

相关问题