0

I want to use ReCaptcha V3 in my Angular 6 project so I have installed ng-recaptcha using the command npm i ng-recaptcha --save as per the doc https://www.npmjs.com/package/ng-recaptcha#installation.

After the installation, the error "ng-recaptcha@7.0.1 requires a peer of @angular/core@^11.0.0 but none is installed" displayed but I don't want to upgrade "@angular/core" to 11.0.0 as my current project uses 6.1.0.

When I try to run the application it is giving the error ERROR in node_modules/ng-recaptcha/recaptcha/recaptcha.component.d.ts(5,43): error TS1005: ';' expected

I am not sure whether any lesser version of ng-recaptcha will resolve my problem or not. Please help

LearnToCode
  • 169
  • 1
  • 5
  • 19

1 Answers1

0

Version 6.1 of ng-recaptch needs Angular version 6 and up

  "peerDependencies": {
    "@angular/core": "^6.0.0 || ^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0"
  },

https://github.com/DethAriel/ng-recaptcha/tree/v6.1.0 try to install it instead

misha1109
  • 358
  • 2
  • 5
  • ng-recaptcha@7.0.1 requires a peer of @angular/core@^11.0.0, meaning ng-recaptcha expects you to supply it with that dependency, but you supplied @angular/core@6. When you downgraded to ng-recaptcha@6.1 you supplied @angular/core@6 which is a valid peer dependency of ng-recaptcha@6.1 – misha1109 Jan 27 '21 at 07:36
  • exactly, the latest version that is compatible with angular 6 of ng-recaptcha is version 6.1 – misha1109 Jan 27 '21 at 07:44
  • 1
    Used version 6.1 of ng-Recaptcha and it solved the problem. Thanks for your detailed info. – LearnToCode Jan 27 '21 at 07:56