Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
646 views
in Technique[技术] by (71.8m points)

typescript - Angular 6 - Installing ng-recaptcha gives error TS1005: ';' expected

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 "[email protected] 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

question from:https://stackoverflow.com/questions/65914273/angular-6-installing-ng-recaptcha-gives-error-ts1005-expected

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...