Home > Blockchain >  Why npm give me this output?
Why npm give me this output?

Time:09-17

I have a problem with ionic, npm ecc. I want to write an app with Ionic framework using Angular. I installed Node.js, ionic, angular, @ionic/angular, native-run, cordova-res, @capacitor/camera, @capacitor/storage, @capacitor/filesystem. But when I put the command ionic start this is the output:

? Starter template: sidemenu
√ Preparing directory .\ludolambru in 1.97ms
√ Downloading and extracting sidemenu starter in 367.60ms
> ionic integrations enable capacitor --quiet -- ludolambru io.ionic.starter
> npm.cmd i --save -E @capacitor/core@latest
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/compiler
npm ERR!   dev @angular/compiler@"~12.1.1" from the root project
npm ERR!   peer @angular/compiler@"12.1.5" from @angular/[email protected]
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     dev @angular/compiler-cli@"~12.1.1" from the root project
npm ERR!     peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~12.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.2.6" from @angular/[email protected]
npm ERR! node_modules/@angular/localize
npm ERR!   peerOptional @angular/localize@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~12.1.1" 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 C:\Users\latin\AppData\Local\npm-cache\eresolve-report.txt for a full     report.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\latin\AppData\Local\npm-cache\_logs\2021-09-17T09_15_32_264Z-    debug.log
[ERROR] An error occurred while running subprocess npm.

        npm.cmd 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 Appflow, the mobile DevOps solution by Ionic

           Continuously build, deploy, and ship apps
        Focus on building apps while we automate the rest

        Learn more: https://ion.link/appflow

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


> npm.cmd i
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/compiler
npm ERR!   dev @angular/compiler@"~12.1.1" from the root project
npm ERR!   peer @angular/compiler@"12.1.5" from @angular/[email protected]
npm ERR!   node_modules/@angular/compiler-cli
npm ERR!     dev @angular/compiler-cli@"~12.1.1" from the root project
npm ERR!     peer @angular/compiler-cli@"^12.0.0 || ^12.1.0-next" from @angular-devkit/[email protected]
npm ERR!     node_modules/@angular-devkit/build-angular
npm ERR!       dev @angular-devkit/build-angular@"~12.1.1" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer @angular/compiler@"12.2.6" from @angular/[email protected]
npm ERR! node_modules/@angular/localize
npm ERR!   peerOptional @angular/localize@"^12.0.0 || ^12.1.0-next" from @angular-    devkit/[email protected]
npm ERR!   node_modules/@angular-devkit/build-angular
npm ERR!     dev @angular-devkit/build-angular@"~12.1.1" 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.

I tried to serch it on google but i didn't find anything. I don't know if I forgot some packages or I was wrong something else.

CodePudding user response:

You have incompatible dependencies,

You have @angular/[email protected] installed but @angular/[email protected] requires @angular/compiler@"12.2.6". I'm guessing you have package.json that looks like:

"@angular/compiler":"12.1.5",
"@angular/localize":"12.2.6"

You'll need to change that so that they can be resolved. It is hard to give explicit advice without seeing your package.json.

  • Related