Home > other >  Cannot re-install old ionic project
Cannot re-install old ionic project

Time:11-15

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: [email protected]
npm ERR! Found: [email protected]
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/[email protected]
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/[email protected]
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

CodePudding user response:

you should update them with npm update and probably need to use --legacy-peer-deps tag. if it doesn't work, you can use npm-check-update package, you can install it globally or use it like this:

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

or you can eventually remove the problematic ones and install them one by one, this method can be particularly useful if your code is too old and you probably need to change some parts of your code as well, you can remove them and check your code for each package as you install them.

CodePudding user response:

You need to have the proper npm and node installed if not you will come across many errors.

  • Related