从Ionic 4升级到Ionic 5后出现平台浏览器错误

mtb9vblg  于 2023-02-14  发布在  Ionic
关注(0)|答案(2)|浏览(174)

错误:
节点模块/@Angular /平台浏览器动态/平台浏览器动态. d. ts(15,10)中的错误:错误TS2305:模块"node_modules/@angular/compiler/compiler"没有导出的成员"JitEvaluator"。
下面是我的包. json:

{
  "scripts": {
    "ng": "ng",
    "start": "ng serve",
    "build": "ng build",
    "test": "ng test",
    "lint": "ng lint",
    "e2e": "ng e2e"
  },
  "private": true,
  "dependencies": {
    "@angular/cdk": "^8.2.3",
    "@angular/cdk-experimental": "^8.2.3",
    "@angular/common": "~8.2.14",
    "@angular/core": "~8.2.14",
    "@angular/fire": "^5.2.1",
    "@angular/forms": "~8.2.14",
    "@angular/http": "^8.0.0-beta.10",
    "@angular/platform-browser": "~8.2.14",
    "@angular/platform-browser-dynamic": "~8.2.14",
    "@angular/router": "~8.2.14",
    "@ionic-native/admob-free": "^5.15.0",
    "@ionic-native/admob-plus": "^5.15.0",
    "@ionic-native/app-version": "^5.15.0",
    "@ionic-native/calendar": "^5.15.0",
    "@ionic-native/camera": "^5.15.0",
    "@ionic-native/core": "^5.15.0",
    "@ionic-native/facebook": "^5.15.0",
    "@ionic-native/file": "5.1.0",
    "@ionic-native/file-transfer": "^5.15.0",
    "@ionic-native/firebase-x": "^5.15.0",
    "@ionic-native/google-analytics": "^5.15.1",
    "@ionic-native/in-app-purchase": "^5.15.0",
    "@ionic-native/network": "^5.15.0",
    "@ionic-native/social-sharing": "^5.15.0",
    "@ionic-native/splash-screen": "^5.15.0",
    "@ionic-native/status-bar": "^5.15.0",
    "@ionic-native/toast": "^5.15.0",
    "@ionic/angular": "^5.0.0",
    "@ionic/ng-toolkit": "^1.1.0",
    "@ionic/pro": "2.0.4",
    "@ionic/schematics-angular": "^1.0.7",
    "angular-2-local-storage": "^3.0.2",
    "cordova": "^9.0.0",
    "cordova-admob-sdk": "0.22.0",
    "cordova-android": "^8.1.0",
    "cordova-android-play-services-gradle-release": "^3.0.0",
    "cordova-ios": "^5.0.1",
    "cordova-plugin-admob-free": "0.25.0",
    "cordova-plugin-androidx": "^1.0.2",
    "cordova-plugin-androidx-adapter": "^1.1.0",
    "cordova-plugin-app-version": "0.1.9",
    "cordova-plugin-calendar": "^5.1.4",
    "cordova-plugin-camera": "4.0.3",
    "cordova-plugin-device": "^2.0.3",
    "cordova-plugin-enable-multidex": "^0.2.0",
    "cordova-plugin-facebook4": "4.2.1",
    "cordova-plugin-file": "6.0.1",
    "cordova-plugin-file-transfer": "1.7.1",
    "cordova-plugin-firebasex": "^6.1.0",
    "cordova-plugin-google-analytics": "^1.8.6",
    "cordova-plugin-inapppurchase": "1.2.0",
    "cordova-plugin-ionic-keyboard": "^2.2.0",
    "cordova-plugin-ionic-webview": "^4.1.2",
    "cordova-plugin-network-information": "2.0.1",
    "cordova-plugin-splashscreen": "^5.0.3",
    "cordova-plugin-statusbar": "^2.4.3",
    "cordova-plugin-whitelist": "^1.3.4",
    "cordova-plugin-x-socialsharing": "5.4.4",
    "cordova-plugin-x-toast": "2.7.2",
    "cordova-promise-polyfill": "0.0.2",
    "core-js": "^2.6.9",
    "es6-promise-plugin": "4.2.2",
    "firebase": "^5.11.1",
    "hammerjs": "^2.0.8",
    "moment": "^2.24.0",
    "ng2-validation": "^4.2.0",
    "rxjs": "^6.5.4",
    "rxjs-compat": "^6.5.3",
    "tslib": "^1.9.0",
    "zone.js": "~0.9.1"
  },
  "devDependencies": {
    "@angular-devkit/architect": "~0.12.3",
    "@angular-devkit/build-angular": "~0.12.3",
    "@angular-devkit/core": "~7.2.3",
    "@angular-devkit/schematics": "~7.2.3",
    "@angular/cli": "~7.2.3",
    "@angular/compiler": "^7.2.15",
    "@angular/compiler-cli": "^7.2.15",
    "@angular/language-service": "^7.2.15",
    "@ionic/angular-toolkit": "^2.1.2",
    "@types/jasmine": "~2.8.8",
    "@types/jasminewd2": "^2.0.8",
    "@types/node": "^10.14.21",
    "codelyzer": "~4.5.0",
    "jasmine-core": "~2.99.1",
    "jasmine-spec-reporter": "~4.2.1",
    "karma": "~3.1.4",
    "karma-chrome-launcher": "~2.2.0",
    "karma-coverage-istanbul-reporter": "^2.1.0",
    "karma-jasmine": "~1.1.2",
    "karma-jasmine-html-reporter": "^0.2.2",
    "protractor": "~5.4.0",
    "ts-node": "^8.4.1",
    "tslint": "~5.12.0",
    "typescript": "~3.1.6"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-x-toast": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-keyboard": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-x-socialsharing": {
        "ANDROID_SUPPORT_V4_VERSION": "24.1.1+"
      },
      "cordova-plugin-app-version": {},
      "cordova-plugin-facebook4": {
        "APP_ID": "00000000000",
        "APP_NAME": "xxxxxxxxx",
        "FACEBOOK_HYBRID_APP_EVENTS": "false",
        "FACEBOOK_ANDROID_SDK_VERSION": "4.40.0"
      },
      "cordova-plugin-network-information": {},
      "cordova-admob-sdk": {
        "PLAY_SERVICES_VERSION": "16.0.1"
      },
      "cordova-plugin-admob-free": {
        "ADMOB_APP_ID": "ca-app-pub-0000000000000000"
      },
      "cordova-plugin-inapppurchase": {},
      "cordova-android-play-services-gradle-release": {
        "PLAY_SERVICES_VERSION": "16+"
      },
      "cordova-plugin-androidx": {},
      "cordova-plugin-androidx-adapter": {},
      "cordova-plugin-enable-multidex": {},
      "cordova-plugin-ionic-webview": {
        "ANDROID_SUPPORT_ANNOTATIONS_VERSION": "27.+"
      },
      "cordova-plugin-calendar": {
        "CALENDAR_USAGE_DESCRIPTION": "xxxxxxxxx",
        "CONTACTS_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-firebasex": {
        "ANDROID_ICON_ACCENT": "#FF00FFFF",
        "ANDROID_PLAY_SERVICES_TAGMANAGER_VERSION": "17.0.0",
        "ANDROID_FIREBASE_CORE_VERSION": "17.0.0",
        "ANDROID_FIREBASE_MESSAGING_VERSION": "19.0.0",
        "ANDROID_FIREBASE_CONFIG_VERSION": "18.0.0",
        "ANDROID_FIREBASE_PERF_VERSION": "18.0.0",
        "ANDROID_FIREBASE_AUTH_VERSION": "18.0.0",
        "ANDROID_CRASHLYTICS_VERSION": "2.10.1",
        "ANDROID_CRASHLYTICS_NDK_VERSION": "2.1.0",
        "ANDROID_SHORTCUTBADGER_VERSION": "1.1.22"
      },
      "cordova-plugin-google-analytics": {
        "GMS_VERSION": "16.0.1"
      }
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

有什么解决办法吗?

pbossiut

pbossiut1#

您可以尝试使用npm-check-update(ncu),它位于:https://www.npmjs.com/package/npm-check-updates
它将非破坏性地检查项目的依赖关系,并告诉你哪些可以更新,然后你可以在更新模式下运行它,它将更新你的package.json,然后你运行npm update来实际更新包。
它帮助我走出了一个大困境,一次当我进入版本地狱,由于试图运行一个离子项目,是在个人电脑上开发的,在mac上。

guicsvcw

guicsvcw2#

如果有人还在这里,我的修正是将我的@angular/compiler更新到9.1.13,因为这是与我的angular版本兼容的版本。删除node_modules后重新运行npm install,它应该可以正常工作。

相关问题