node.js - 安装离子时的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
我运行了以下命令进行调试:
npm uninstall -g ionic
npm install -g @ionic/cli
npm install -g cordova @ionic/cli
现在还有一个多星期的时间。
解决方案
我在windows中复制并粘贴了这个路径
C:\Users\Lari\AppData\Roaming\npm\ionic
删除所有离子文件夹,然后这个路径
C:\Users\Lari\AppData\Roaming\npm
也删除了一些存在的离子文件。
运行 npm I -g @ionic/cli,它确实安装了 6.11.0 版。
谢谢大家,希望对某人有所帮助
推荐阅读
- c - 是否可以在 C 中的结构中创建“空”成员?
- azure - Azure ARM 应用服务存储装载不再有效
- javascript - 默认导出的 Typescript 接口
- c# - 错误:“Program.Coefficient()”:并非所有代码路径都返回值
- python - 在实例化时动态改变对象类型
- java - 为什么我的 ArrayList 中已经有元素?
- ios - 是否可以在 iOS 中制作对用户不可见且对跳板隐藏的后台服务应用程序?
- c# - net.sf.jni4net; Bridge.CreateJVM(bridgeSetup); 无法为“X”KB 对象堆保留足够的空间;
- javascript - 缩小删除日期但保留时间
- cefsharp - Cefsharp : 一般用法页面的请求上下文问题