Ionic 无法重新安装旧的离子项目

mnemlml8  于 2022-12-08  发布在  Ionic
关注(0)|答案(2)|浏览(205)

I have an ionic project that I haven't updated for some time.
The project worked well and I installed the ionic app on many devices.
Today I downloaded the code from git hub and then run the command npm install but the command ended with dependencies errors:

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

I tried to follow the suggested commands but the result did not change.
How can I install and update all the packages without any dependency issue?
Many thanks

pengsaosao

pengsaosao1#

您应该使用npm update更新它们,且可能需要使用--legacy-peer-deps标记。如果它不起作用,您可以使用npm-check-update包,您可以全局安装它,或者像这样使用它:

$ npx npm-check-updates -u
$ npm i

或者您可以最终删除有问题的程序包并逐个安装它们,如果您的代码太旧并且您可能还需要更改代码的某些部分,则此方法特别有用,您可以删除它们并在安装时检查每个程序包的代码。

tkclm6bt

tkclm6bt2#

您需要安装正确的npm和节点,否则您将遇到许多错误。

相关问题