i have a problem when i try to install package npm on angular, i have this kind of error but i don't understand how i should do to solve it
PS C:\Users\user\Documents\Progetti\myProject\ng-app\src\app> npm i angular-calendar npm WARN config global
--global,
--localare deprecated. Use
--location=global` instead.
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: @angular/[email protected]
npm ERR! node_modules/@angular/core
npm ERR! @angular/core@"~13.3.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/core@">=14.0.0" from [email protected]
npm ERR! node_modules/angular-calendar
npm ERR! angular-calendar@"*" 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! A complete log of this run can be found in: npm ERR! C:\Users\user\AppData\Local\npm-cache_logs\2022-12-02T08_36_42_518Z-debug-0.log PS C:\Users\user\Documents\Progetti\myProject\ng-app\src\app> `
I have already done the following steps:
- deleted "node_modules" folder
- deleted the "package-lock.json"
- delete cache with "npm cache clean --force"
- called the "npm install --save" command
if i try to install the npm packet i have always the same error where am I wrong thank you
CodePudding user response:
According to the docs you should install with this command:
npm install --save angular-calendar date-fns
or use
ng add angular-calendar
CodePudding user response:
The errors message states that you have packages depending on both @angular/core versions ~13.3.0 and >=14.0.0. Since you can only have one version of a package, and one package can't be version 13.3.x and >= 14.x.x.
Figure out packages you're installing together with their dependencies. It's hard to say from your unformatted error, but I'd assume latest version of the angular-calendar
requires >= 14 and you're using 13.3.x.
Either download older version of angular-calendar
that works with 13.x or upgrade your project to 14.x