由于依赖性问题,离子启动失败

2024-03-03

我刚刚安装了 Ionic

npm install -g @ionic/cli

当我尝试跑步时

ionic start ionic-test-app

初始化失败并出现 npm 依赖错误。 关于名为 postcss 的包的错误版本的问题。

$ ionic start ionic-test-app

Pick a framework! ????

Please select the JavaScript framework to use for your new app. To bypass this prompt next time,
supply a value for the --type option.

? Framework: Angular

Let's pick the perfect starter template! ????

Starter templates are ready-to-go Ionic apps that come packed with everything you need to build your
app. To bypass this prompt next time, supply template, the second argument to ionic start.

? Starter template: blank
? ./ionic-test-app exists. Overwrite? Yes
✔ Preparing directory ./ionic-test-app in 6.79ms
✔ Downloading and extracting blank starter in 188.52ms
? Integrate your new app with Capacitor to target native iOS and Android? Yes
> ionic integrations enable capacitor --quiet -- ionic-test-app io.ionic.starter
> npm i --save -E @capacitor/core@latest
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/postcss
npm ERR!   postcss@"8.2.14" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!     peer @angular-devkit/build-angular@"^0.1102.4" from @ionic/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@ionic/angular-toolkit
npm ERR!       dev @ionic/angular-toolkit@"^3.1.1" from the root project
npm ERR!   peer postcss@"^8.1.0" from [email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/autoprefixer
npm ERR!     autoprefixer@"10.2.4" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
npm ERR!   9 more (css-loader, cssnano, postcss-import, postcss-loader, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer postcss@"^8.2.15" from [email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/cssnano/node_modules/cssnano-preset-default
npm ERR!   cssnano-preset-default@"^5.0.1" from [email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/cssnano
npm ERR!     cssnano@"5.0.2" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/sekthor/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sekthor/.npm/_logs/2021-05-20T17_05_21_790Z-debug.log
[ERROR] An error occurred while running subprocess npm.
        
        npm i --save -E @capacitor/core@latest exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

Installing dependencies may take several minutes.

  ──────────────────────────────────────────────────────────────────────────────

         Ionic Advisory, tailored solutions and expert services by Ionic

                             Go to market faster ????
                    Real-time troubleshooting and guidance ????
        Custom training, best practices, code and architecture reviews ????
      Customized strategies for every phase of the development lifecycle ????

                        ????  https://ion.link/advisory  ????

  ──────────────────────────────────────────────────────────────────────────────


> npm i
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! Found: [email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/postcss
npm ERR!   postcss@"8.2.14" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!     peer @angular-devkit/build-angular@"^0.1102.4" from @ionic/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@ionic/angular-toolkit
npm ERR!       dev @ionic/angular-toolkit@"^3.1.1" from the root project
npm ERR!   peer postcss@"^8.1.0" from [email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/autoprefixer
npm ERR!     autoprefixer@"10.2.4" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
npm ERR!   9 more (css-loader, cssnano, postcss-import, postcss-loader, ...)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer postcss@"^8.2.15" from [email protected] /cdn-cgi/l/email-protection
npm ERR! node_modules/cssnano/node_modules/cssnano-preset-default
npm ERR!   cssnano-preset-default@"^5.0.1" from [email protected] /cdn-cgi/l/email-protection
npm ERR!   node_modules/cssnano
npm ERR!     cssnano@"5.0.2" from @angular-devkit/[email protected] /cdn-cgi/l/email-protection
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~0.1102.4" from the root project
npm ERR!       1 more (@ionic/angular-toolkit)
npm ERR! 
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
npm ERR! 
npm ERR! See /home/sekthor/.npm/eresolve-report.txt for a full report.

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/sekthor/.npm/_logs/2021-05-20T17_05_28_760Z-debug.log
[ERROR] An error occurred while running subprocess npm.
        
        npm i exited with exit code 1.
        
        Re-running this command with the --verbose flag may provide more information.

我对 npm 相当陌生,我似乎无法在此网站或互联网上的其他任何地方找到解决方案。

我已经尝试过--force and --legacy-peer-deps,但收到同样的错误。

此错误的原因是什么以及如何修复它?

我的节点、npm 和 ionic 版本是:

$ node --version
v16.2.0
$ npm --version
7.13.0
$ ionic --version
6.16.1

由于某种原因,我无法让它在节点版本上工作16.2.0。 但是,使用节点版本管理器nvm我安装了节点的第二个实例,LTS 版本14.17.0。 通过此降级,设置过程可以正常工作。

nvm install 14.17.0
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

由于依赖性问题,离子启动失败 的相关文章

随机推荐

  • 对象 # 没有方法“done”

    我试图实现简单的ajax GET 请求 在回调部分我想调用一些函数 代码如下 ajax url ajax pages ajx getcard php id obj value context document body done funct
  • 启动 Rails 服务器 Sidekiq 时出错

    当我尝试启动我的服务器时 rails s 给我以下错误 管理员 rvm gems ruby 1 9 3 p392 gems bundler 1 11 2 lib bundler runtime rb 81 in rescue in bloc
  • java中私有变量的序列化

    我有一个关于序列化的问题 如果我的类有私有变量并且没有 getter 和 setter 那么序列化 API 将如何读取这些变量的值 首先 访问权限是编译时功能 访问在运行时不受控制 这可能会让您感到困惑 但请尝试执行以下操作 创建 A 类的
  • 制作等长向量的列表

    在一个关于SO的问题中 LINK https stackoverflow com questions 10661295 apply a function over groups of columns 一个海报问了一个问题 我给出了一个有效的
  • jQuery .toggle() 显示和隐藏子菜单

    我正在使用这个问题的代码来进行显示 隐藏切换 jQuery toggle 显示和隐藏子菜单 https stackoverflow com questions 9469807 jquery toggle to show and hide a
  • OSX 惯性滚动导致 mousewheel.js 通过最轻微的滚动运动注册多个鼠标滚轮事件

    我正在开发一个非常标准的 Flexslider 实例 柔性滑块 http flexslider woothemes com 与jquery mousewheel js https github com brandonaaron jquery
  • 使用 subversion 将更改提交到与当前签出分支不同的分支

    我一直在处理从开发线检出的代码 发现所做的更改可能是破坏性更改 需要在提交到主开发树之前移动到实验分支 但是 我没有签出实验分支 并且我不想丢失已经进行的更改 有没有办法将工作文件夹中的更改提交到与最初签出的分支不同的分支 您应该从已知的分
  • Three.js中是否有一个容器类型对象来转换一组孩子?

    Three js 中是否有一个容器或节点对象 可以将多个网格添加为子对象 以便它们可以一起转换 一个不可见的容器 允许对组中的所有子对象执行转换 thanks Example http mrdoob github com three js
  • 在单个查询中将行插入到多个表中,从涉及的表中进行选择

    我有两个以下形式的表 即 每个 foo 都链接到一个栏 CREATE TABLE foo id INTEGER PRIMARY KEY x INTEGER NOT NULL y INTEGER NOT NULL bar id INTEGER
  • 如何用下划线模板显示JS对象?

    我想使用下划线模板显示 JS 数据对象 我似乎无法弄清楚如何钻取对象以获取国家 地区名称或其他日期 例如 tarrifType 并使用我的模板显示它 该物体看起来像这样 var items country China tarrifType
  • 如何在 AngularJS 中使用 Web Worker?

    我在用着AngularJS 种子 https github com angular angular seed我想看看 Web Worker 的有效实现 我想让一个简单的 Web Worker 工作以便理解它 但我遇到了功能问题 我的 Web
  • 如何以编程方式从后台恢复 Android Activity

    情况 假设我当前正在启动应用程序 Activity A 一段时间后 我按下 主页 按钮 应用程序 A 进入后台 此时 我开始使用另一个应用程序 B 例如 youtube 等 当前最小化到后台的应用程序 A 中发生了一些事情 在这种情况下发生
  • 如何在 Google 搜索 iframe 上设置自定义宽度?

    我正在尝试使用谷歌搜索我的网站 http www houseofhawkins com search php http www houseofhawkins com search php 它在某些屏幕分辨率下表现不佳 这是谷歌给出的代码 d
  • 编排微服务

    编排微服务的标准模式是什么 如果一个微服务只知道自己的领域 但有一个数据流需要多个服务以某种方式交互 那么该怎么做呢 假设我们有这样的东西 开具发票 Shipment 为了便于论证 我们假设订单发货后 就应该创建发票 在某个地方 有人按下了
  • VBA Excel 的比率条件要求

    我有一个财务数据 表明项目的健康状况 并根据差异填充颜色和字母来指示健康状况 例如 如果方差小于 5 则用字母 G 填充绿色 大于 5 但小于 20 则填充 Y 大于 20 R 我已经使用 if 语句来实现这一点 但是我需要填充整个项目的颜
  • bazel是否支持不同平台上的远程执行?

    具体来说 我想从 Mac 主机对 Windows 工作线程运行测试 评论在不同的机器上运行 bazel 远程执行器测试 https stackoverflow com questions 44354378 running bazel rem
  • 替换包装食谱中的模板

    我正在尝试为以下内容写一本包装食谱厨师石墨回购 https github com hw cookbooks graphite 在配方carbon rb中 出现以下几行 template node graphite base dir conf
  • 使用默认文本反应本机 iOS 打开消息应用程序

    Code Linking openURL sms number body Hi 我尝试使用手机号码和内容打开消息应用程序 但是手机号码和内容合并到一个部分中 如何解决此问题 将提供任何帮助 提前致谢 iOS 上的工作语法 截至 11 2 似
  • 2012年如何在Linux上设置googletest?

    我使用的是Linux机器 我已经从以下位置下载了 googletest 包here http code google com p googletest downloads detail name gtest 1 6 0 zip 但是 没有安
  • 由于依赖性问题,离子启动失败

    我刚刚安装了 Ionic npm install g ionic cli 当我尝试跑步时 ionic start ionic test app 初始化失败并出现 npm 依赖错误 关于名为 postcss 的包的错误版本的问题 ionic