TS1005 error after installing @capacitor/preferences plugin in ionic project

After installing @capacitor/preferences plugin in my ionic6 project , I keep getting the following TS1005 errors

[ng] ERROR in node_modules/@capacitor/preferences/dist/esm/index.d.ts:1:13 - error TS1005: '=' expected.
[ng] 1 import type { PreferencesPlugin } from './definitions';
[ng]               ~
[ng] node_modules/@capacitor/preferences/dist/esm/index.d.ts:1:40 - error TS1005: ';' expected.
[ng] 1 import type { PreferencesPlugin } from './definitions';

I updated all dependencies, typescript, core-js and I have other capacitor plugins installed and synced but I still get the same error when I run “ionic cap sync” with the @capacitor/preferences plugin.

This is my package.json file

{
  "name": "ionic-bank",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "https://ionicframework.com/",
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "resolutions": {
    "@babel/preset-env": "^7.8.7"
  },
  "private": true,
  "dependencies": {
    "@angular/common": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/forms": "~8.2.14",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@awesome-cordova-plugins/core": "^6.3.0",
    "@capacitor/android": "4.7.0",
    "@capacitor/app": "^4.1.1",
    "@capacitor/core": "^4.7.0",
    "@capacitor/haptics": "^4.1.0",
    "@capacitor/keyboard": "^4.1.1",
    "@capacitor/preferences": "^4.0.2",
    "@capacitor/status-bar": "^4.1.1",
    "@ionic-native/core": "^5.26.0",
    "@ionic-native/sms-retriever": "^5.36.0",
    "@ionic-native/splash-screen": "^5.26.0",
    "@ionic-native/status-bar": "^5.26.0",
    "@ionic/angular": "^5.1.1",
    "chart.js": "^2.9.3",
    "cordova-android": "^8.1.0",
    "cordova-ios": "^5.1.1",
    "cordova-plugin-sms-receive": "^2.0.0",
    "cordova-res": "^0.12.0",
    "core-js": "^3.23.3",
    "ng2-charts": "^2.3.2",
    "rxjs": "^6.5.5",
    "tslib": "^1.13.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/build-angular": "^0.803.26",
    "@angular/cli": "^8.3.26",
    "@angular/compiler": "~8.2.14",
    "@angular/compiler-cli": "~8.2.14",
    "@angular/language-service": "~8.2.14",
    "@capacitor/cli": "^4.7.0",
    "@ionic/angular-toolkit": "^2.1.1",
    "@types/jasmine": "~3.3.8",
    "@types/jasminewd2": "~2.0.3",
    "@types/node": "~8.9.4",
    "codelyzer": "^5.2.2",
    "cordova-plugin-device": "^2.1.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.2.1",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "jasmine-core": "~3.4.0",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~4.1.0",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "~2.0.1",
    "karma-jasmine": "~2.0.1",
    "karma-jasmine-html-reporter": "^1.5.4",
    "npm-force-resolutions": "0.0.3",
    "protractor": "^5.4.4",
    "ts-node": "~7.0.0",
    "tslint": "~5.15.0",
    "typescript": "~3.4.3"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {
	"ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-ionic-keyboard": {}
    },
    "platforms": [
      "android",
      "ios"
    ]
  }
}

What could be the possible cause?