首页 > 解决方案 > 安装离子时的npm ERR

问题描述

我在 Windows 10 上尝试安装 Ionic。我在终端中运行了以下代码:

npm install -g @ionic/CLI

我得到这个错误:

npm ERR! code EEXIST
npm ERR! path C:\Users\Lari\AppData\Roaming\npm\ionic.ps1
npm ERR! Refusing to delete C:\Users\Lari\AppData\Roaming\npm\ionic.ps1: is outside C:\Users\Lari\AppData\Roaming\npm\node_modules\@ionic\cli and not a link
npm ERR! File exists: C:\Users\Lari\AppData\Roaming\npm\ionic.ps1
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with force to overwrite files recklessly.

npm ERR! A complete log of this can be found in:
npm ERR! C:\Users\Lari\AppData\Roaming\npm-cache\_logs\2020-08-12T22_24_22_577Z-debug.log

我运行了以下命令进行调试:

现在还有一个多星期的时间。

标签: node.jsangularcordovaionic-frameworknpm

解决方案


我在windows中复制并粘贴了这个路径

C:\Users\Lari\AppData\Roaming\npm\ionic

删除所有离子文件夹,然后这个路径

C:\Users\Lari\AppData\Roaming\npm

也删除了一些存在的离子文件。

运行 npm I -g @ionic/cli,它确实安装了 6.11.0 版。
谢谢大家,希望对某人有所帮助


推荐阅读