我有一个离子项目,我已经有一段时间没有更新了。
该项目运行良好,我在许多设备上安装了离子应用程序。
今天,我从git下载了代码,然后运行命令npm install,但是该命令以依赖项错误结束:
MacBook-Pro-di-Silvia:scorekeeper gottasilvia$ npm install
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: scorekeeper@0.0.1
npm ERR! Found: rxjs@6.6.7
npm ERR! node_modules/rxjs
npm ERR! rxjs@"^6.3.3" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"^5.5.0" from @angular/core@5.0.0
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"5.0.0" from the root project
npm ERR! peer @angular/core@"5.0.0" from @angular/common@5.0.0
npm ERR! node_modules/@angular/common
npm ERR! @angular/common@"5.0.0" from the root project
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 /Users/gottasilvia/.npm/eresolve-report.txt for a full report.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/gottasilvia/.npm/_logs/2022-11-12T17_16_01_363Z-debug-0.log我试着遵循建议的命令,但结果没有改变。
如何在没有依赖关系的情况下安装和更新所有软件包?
非常感谢
发布于 2022-11-13 16:08:47
您应该使用npm update更新它们,并且可能需要使用--legacy-peer-deps标记。如果它不起作用,您可以使用npm-check-update软件包,您可以全局安装它,或者像这样使用它:
$ npx npm-check-updates -u
$ npm i或者您最终可以删除有问题的代码并逐一安装,如果您的代码太旧,并且您可能需要更改代码的某些部分,则此方法可能特别有用,您可以在安装它们时删除它们并检查每个包的代码。
发布于 2022-11-14 15:59:08
您需要安装适当的npm和节点,否则会遇到许多错误。
https://stackoverflow.com/questions/74415154
复制相似问题