Unable to resolve dependency tree @angularx-social-login

3.2k Views Asked by At

I'm using angular 12 and I need to implement a social login using @abacritt/angularx-social-login. When I use npm i --save @abacritt/angularx-social-login, I get the error

Unable to resolve dependency tree While resolving: app-name Found: @angular/[email protected] @angular/common@~12.2.0 from the root project

Could not resolve dependency: peer @angular/common@"^13.0.0 || ^14.0.0" from @abacritt/[email protected] @abacritt/angularx-social-login@"*" from the root project Fix the upstream dependency conflict, or retry this command with --force or --legacy-peer-deps to accept an incorrect (and potentially broken) dependency resolution.

I can't upgrade the angular version, and when I tried to use npm i --save angularx-social-login, some parts are deprecated and don't work anymore.

How can I install a @abacritt/angularx-social-login compatible with angular 12?

3

There are 3 best solutions below

0
JakSok On

In angular 12 use just npm i --save angularx-social-login:4 @abacritt/angularx-social-login is for Angular 13 and 14. Check github repo https://github.com/abacritt/angularx-social-login#subscribe-to-the-authentication-state

0
LiJell On

angularx-social-login:4 @abacritt/angularx-social-login will be deprecated.

For Angular 12, there has been an updated @abacritt/angularx-social-login version 1.2.4-ngx12.0 which you can read docs from npmjs.com.

You can install by

npm i @abacritt/[email protected]

Since Docs is not updated yet, you should follow as bleow when you import:

import { SocialLoginModule, SocialAuthServiceConfig } from '@abacritt/angularx-social-login';
0
Rick On

Be sure to remove this line from package.json and package-lock.json:

"angularx-social-login": "^4.1.0",

make sure you are using the new version on angular social login:

npm i @abacritt/angularx-social-login

import { SocialLoginModule, SocialAuthServiceConfig } from '@abacritt/angularx-social-login';