Несоответствие версии метаданных для модуля ... найдена версия, ожидаемая 3 в ionic3 - PullRequest
0 голосов
/ 27 апреля 2018

Я пытаюсь создать свое приложение с --prod, в то время как я делаю это, у меня возникла проблема с ошибкой несоответствия версий, я думаю, что это вызывает для ngx-restrict версии, как я могу решить эту проблему, чтобы мое приложение работало в В режиме prod, когда я запускал свое приложение в режиме dev, заставка отнимает больше времени, поэтому, проводя исследование, я получил решение запустить приложение в режиме prod, выполняя при этом следующее: ошибка.

Ошибка, которую я получил:

Error: Metadata version mismatch for module D:/Tineri-v3/node_modules/ngx-restangular/node_modules/@angular/core/core.d.ts, found version 4, expected 3
    at StaticSymbolResolver.getModuleMetadata (D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:24474:34)
    at StaticSymbolResolver._createSymbolsOf (D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:24260:46)
    at StaticSymbolResolver.getSymbolsOf (D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:24241:14)
    at D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:23023:30
    at Array.forEach (<anonymous>)
    at extractProgramSymbols (D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:23022:79)
    at AotCompiler.compileAll (D:\Tineri-v3\node_modules\@angular\compiler\bundles\compiler.umd.js:22720:47)
    at CodeGenerator.codegen (D:\Tineri-v3\node_modules\@angular\compiler-cli\src\codegen.js:30:14)
    at Function.NgTools_InternalApi_NG_2.codeGen (D:\Tineri-v3\node_modules\@angular\compiler-cli\src\ngtools_api.js:61:30)
    at D:\Tineri-v3\node_modules\@ionic\app-scripts\dist\aot\aot-compiler.js:182:73

package.json: :

{
  "name": "myappionic",
  "version": "0.0.1",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "lint": "ionic-app-scripts lint",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "4.1.3",
    "@angular/compiler": "4.1.3",
    "@angular/compiler-cli": "4.1.3",
    "@angular/core": "4.1.3",
    "@angular/forms": "4.1.3",
    "@angular/http": "4.1.3",
    "@angular/platform-browser": "4.1.3",
    "@angular/platform-browser-dynamic": "4.1.3",
    "@ionic-native/android-permissions": "^4.5.3",
    "@ionic-native/app-version": "^4.5.3",
    "@ionic-native/camera": "^4.6.0",
    "@ionic-native/clipboard": "^4.6.0",
    "@ionic-native/core": "3.12.1",
    "@ionic-native/device": "^4.5.3",
    "@ionic-native/diagnostic": "^4.5.3",
    "@ionic-native/file": "^4.5.3",
    "@ionic-native/file-opener": "^4.5.3",
    "@ionic-native/file-transfer": "^4.5.3",
    "@ionic-native/firebase": "^4.6.0",
    "@ionic-native/geolocation": "^4.5.3",
    "@ionic-native/google-analytics": "^4.7.0",
    "@ionic-native/http": "^4.5.3",
    "@ionic-native/in-app-browser": "^4.5.3",
    "@ionic-native/network": "^4.5.3",
    "@ionic-native/photo-viewer": "^4.6.0",
    "@ionic-native/social-sharing": "^4.5.3",
    "@ionic-native/splash-screen": "3.12.1",
    "@ionic-native/status-bar": "3.12.1",
    "@ionic/storage": "2.0.1",
    "@ngui/map": "^0.20.2",
    "@types/googlemaps": "^3.30.7",
    "angularfire2": "^5.0.0-rc.6",
    "com-sarriaroman-photoviewer": "^1.1.16",
    "cordova-android": "7.0.0",
    "cordova-clipboard": "^1.1.1",
    "cordova-ios": "4.5.4",
    "cordova-plugin-advanced-http": "^1.9.1",
    "cordova-plugin-android-permissions": "~1.0.0",
    "cordova-plugin-app-version": "^0.1.9",
    "cordova-plugin-camera": "^4.0.2",
    "cordova-plugin-console": "^1.0.5",
    "cordova-plugin-device": "^1.1.4",
    "cordova-plugin-file": "^6.0.1",
    "cordova-plugin-file-opener2": "^2.0.19",
    "cordova-plugin-file-transfer": "~1.7.1",
    "cordova-plugin-firebase": "^0.1.25",
    "cordova-plugin-geolocation": "^4.0.1",
    "cordova-plugin-google-analytics": "^1.8.3",
    "cordova-plugin-inappbrowser": "^2.0.2",
    "cordova-plugin-network-information": "^2.0.1",
    "cordova-plugin-splashscreen": "^4.0.3",
    "cordova-plugin-statusbar": "^2.2.2",
    "cordova-plugin-telerik-imagepicker": "^2.1.10",
    "cordova-plugin-whitelist": "^1.3.1",
    "cordova-plugin-x-socialsharing": "^5.3.1",
    "cordova.plugins.diagnostic": "^4.0.0",
    "es6-promise-plugin": "^4.1.0",
    "firebase": "^4.11.0",
    "ionic-angular": "3.6.0",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "jquery": "^3.3.1",
    "moment": "^2.20.1",
    "ngx-restangular": "^2.0.2",
    "promise-polyfill": "^7.1.0",
    "rxjs": "^5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.12"
  },
  "devDependencies": {
    "@ionic/app-scripts": "3.1.8",
    "@ionic/cli-plugin-cordova": "1.6.2",
    "@ionic/cli-plugin-ionic-angular": "1.4.0",
    "typescript": "2.3.4"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-network-information": {},
      "cordova-plugin-advanced-http": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-whitelist": {},
      "cordova-plugin-console": {},
      "cordova-plugin-statusbar": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-app-version": {},
      "cordova-plugin-android-permissions": {},
      "cordova-plugin-file": {},
      "cordova-plugin-file-transfer": {},
      "cordova-plugin-inappbrowser": {},
      "cordova-plugin-file-opener2": {},
      "cordova.plugins.diagnostic": {},
      "cordova-plugin-x-socialsharing": {},
      "cordova-plugin-geolocation": {},
      "com-sarriaroman-photoviewer": {},
      "cordova-clipboard": {},
      "cordova-plugin-camera": {},
      "cordova-plugin-firebase": {},
      "cordova-plugin-google-analytics": {}
    },
    "platforms": [
      "ios",
      "android"
    ]
  }
}

Ионная информация: :

cli packages: (C:\Users\midhun\AppData\Roaming\npm\node_modules)

    @ionic/cli-utils  : 1.19.1
    ionic (Ionic CLI) : 3.19.1

global packages:

    cordova (Cordova CLI) : 8.0.0

local packages:

    @ionic/app-scripts : 3.1.8
    Cordova Platforms  : android 7.0.0 ios 4.5.4
    Ionic Framework    : ionic-angular 3.6.0

System:

    Node : v8.9.4
    npm  : 5.6.0
    OS   : Windows 7

Пожалуйста, отыщите меня от этой проблемы, спасибо вам за это

1 Ответ

0 голосов
/ 30 апреля 2018

Сначала удалите или удалите ngx-restangular, затем просто измените файл пакета json следующим образом:

Сначала попытайтесь удалить Каретку (^) из номера версии

"dependencies": {
    "ngx-restangular": "1.0.13"
}

затем запустите:

npm install

это вызвано тем, что для других зависимостей или угловых версий нужна конкретная версия для сборки проекта.

Надеюсь, это поможет!

...