Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@capacitor/angular cannot be added #23

Open
raberana opened this issue Oct 31, 2021 · 3 comments
Open

@capacitor/angular cannot be added #23

raberana opened this issue Oct 31, 2021 · 3 comments

Comments

@raberana
Copy link

raberana commented Oct 31, 2021

Hello. I'm trying to add @capacitor/angular into my project using the command ng add @capacitor/angular

I met some warnings before installation and the actual installation failed as well.
image

The package @capacitor/angular will be installed and executed.
Would you like to proceed? Yes
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR! 
npm ERR! While resolving: sample@0.0.0
npm ERR! Found: rxjs@6.6.7
npm ERR! node_modules/rxjs
npm ERR!   rxjs@"~6.6.0" from the root project
npm ERR!   rxjs@"6.6.7" from @angular-devkit/core@12.2.12
npm ERR!   node_modules/@angular-devkit/core
npm ERR!     peer @angular-devkit/core@">=12.0.0" from @capacitor/angular@2.0.0
npm ERR!     node_modules/@capacitor/angular
npm ERR!       @capacitor/angular@"*" from the root project
npm ERR!     @angular-devkit/core@"12.2.12" from @angular-devkit/schematics@12.2.12
npm ERR!     node_modules/@angular-devkit/schematics
npm ERR!       peer @angular-devkit/schematics@">=12.0.0" from @capacitor/angular@2.0.0
npm ERR!       node_modules/@capacitor/angular
npm ERR!         @capacitor/angular@"*" from the root project
npm ERR!   1 more (@angular-devkit/schematics)
npm ERR! 
npm ERR! Could not resolve dependency:
npm ERR! peer rxjs@"~6.4.0" from @capacitor/angular@2.0.0
npm ERR! node_modules/@capacitor/angular
npm ERR!   @capacitor/angular@"*" 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 creating a new Angular project, installed capacitorJS and ran ng add @capacitor/angular
but I still faced the same issue.

@AUK4GIT
Copy link

AUK4GIT commented Nov 1, 2021

Hi, Even I am unable to add the package to the latest angular project

The package's peer dependencies(rxjs@6.4.0, typescript@3.4.3 version) versions are not satisfying with the latest angular dependencies version(rxjs@6.6.0, typescript@4.3.5 version) and hence there is a conflict.

We would like to work with the latest rxjs and typescript versions instead of downgrading.

adding the package with the flags --force, or --legacy-peer-deps did not help

`Angular CLI: 12.2.12
  Node: 16.10.0 (Unsupported)
  Package Manager: npm 7.24.0
  OS: darwin x64

  Angular:
  ...

  Package                      Version
  ------------------------------------------------------
  @angular-devkit/architect    0.1202.12 (cli-only)
  @angular-devkit/core         12.2.12 (cli-only)
  @angular-devkit/schematics   12.2.12 (cli-only)
  @schematics/angular          12.2.12 (cli-only)`



` ℹ Using package manager: npm
   ✖ Unable to find compatible package.  Using 'latest'.
   ✖ Package has unmet peer dependencies. Adding the package may not succeed.

   The package @capacitor/angular will be installed and executed.
   Would you like to proceed? Yes
   npm ERR! code ERESOLVE
   npm ERR! ERESOLVE unable to resolve dependency tree
   npm ERR! 
   npm ERR! While resolving: my-account@2.0.0
   npm ERR! Found: typescript@4.3.5
   npm ERR! node_modules/typescript
   npm ERR!   dev typescript@"~4.3.5" from the root project
   npm ERR! 
   npm ERR! Could not resolve dependency:
   npm ERR! peer typescript@"~3.4.3" from @capacitor/angular@2.0.0
   npm ERR! node_modules/@capacitor/angular
   npm ERR!   @capacitor/angular@"*" 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/etguser/.npm/eresolve-report.txt for a full report.

   npm ERR! A complete log of this run can be found in:
   npm ERR!     /Users/etguser/.npm/_logs/2021-11-01T04_31_48_575Z-debug.log
   ✖ Package install failed, see above.`

@AUK4GIT
Copy link

AUK4GIT commented Nov 2, 2021

I am able to proceed after setting the flag legacy-peer-deps to true
npm config set legacy-peer-deps true
ng add @capacitor/angular

@sjregan
Copy link

sjregan commented Dec 20, 2021

Yep, same issue with the version of rxjs being outdated in the @capacitor/angular package.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants