【问题标题】:Ionic modules problem after I tried to upgrade my Angular CLI ,Ionic and cordova尝试升级 Angular CLI、Ionic 和 cordova 后的 Ionic 模块问题
【发布时间】:2018-11-06 16:31:07
【问题描述】:

我尝试升级我的 Angular CLI、Ionic 和 Cordova 版本,现在我无法再运行我的 ionic 服务,当我尝试卸载版本并安装旧版本时,我一直收到错误,但有点不同。

现在我明白了:

Module '"C:/Users/mylaptop30/Desktop/ArbesTech-Projects/Andrian/InstantDealNew/node_modules/firebase/index"' has no exported member 'functions'.

我的版本是:Ionic@3.9.2,Cordova 8.1.2(Cordova-lib@8.1.1)Angular 6.4.1.

在我尝试使用我的 firebase 版本之前:

cannot find module firebase/app

当我尝试升级我的 Angular CLI 时,我得到了:

Cannot redeclare block-scoped variable 'ngDevMode'

我在整个互联网上搜索了每个错误的解决方案,但是当我修复一个错误时,另一个错误即将到来。 请帮帮我!!!

这是我的Package.json 文件:

  "name": "Instant Deal",
  "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": "^5.0.3",
    "@angular/compiler": "^5.0.3",
    "@angular/compiler-cli": "^5.0.3",
    "@angular/core": "^5.0.3",
    "@angular/forms": "^5.0.3",
    "@angular/http": "^5.0.3",
    "@angular/platform-browser": "^5.0.3",
    "@angular/platform-browser-dynamic": "^5.0.3",
    "@ionic-native/camera": "^4.7.0",
    "@ionic-native/contacts": "^4.5.2",
    "@ionic-native/core": "4.7.0",
    "@ionic-native/facebook": "4.5.2",
    "@ionic-native/file": "^4.5.2",
    "@ionic-native/firebase": "4.5.2",
    "@ionic-native/geolocation": "^4.5.2",
    "@ionic-native/google-plus": "^4.5.2",
    "@ionic-native/keyboard": "^4.5.2",
    "@ionic-native/media-capture": "^4.5.2",
    "@ionic-native/social-sharing": "^4.15.0",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "^4.7.0",
    "@ionic/storage": "2.1.3",
    "android": "0.0.8",
    "angularfire2": "^5.0.0-rc.4",
    "cordova-browser": "5.0.4",
    "cordova-ios": "^4.5.5",
    "cordova-plugin-accountkit": "^1.4.0",
    "cordova-plugin-camera": "^4.0.3",
    "cordova-plugin-compat": "^1.2.0",
    "cordova-plugin-contacts": "^2.3.1",
    "cordova-plugin-device": "^2.0.2",
    "cordova-plugin-facebook4": "^1.10.1",
    "cordova-plugin-file": "^4.3.3",
    "cordova-plugin-geolocation": "^2.4.3",
    "cordova-plugin-googleplus": "^5.3.2",
    "cordova-plugin-ionic-keyboard": "^2.1.3",
    "cordova-plugin-ionic-webview": "^1.2.1",
    "cordova-plugin-media-capture": "^1.4.3",
    "cordova-plugin-splashscreen": "^5.0.2",
    "cordova-plugin-statusbar": "^2.4.2",
    "cordova-plugin-whitelist": "^1.3.3",
    "cordova-plugin-x-socialsharing": "^5.4.1",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "^4.8.0",
    "ionic-angular": "3.9.2",
    "ionic-plugin-keyboard": "^2.2.1",
    "ionicons": "3.0.0",
    "moment": "^2.22.1",
    "node-sass": "^4.9.0",
    "rxjs": "^5.5.2",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.2.0",
    "typescript": "^2.4.2"
  },
  "description": "An Ionic project",
  "cordova": {
    "plugins": {
      "cordova-plugin-whitelist": {},
      "cordova-plugin-device": {},
      "cordova-plugin-splashscreen": {},
      "cordova-plugin-ionic-webview": {},
      "cordova-plugin-ionic-keyboard": {},
      "ionic-plugin-keyboard": {},
      "cordova-plugin-contacts": {
        "CONTACTS_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-media-capture": {
        "CAMERA_USAGE_DESCRIPTION": " ",
        "MICROPHONE_USAGE_DESCRIPTION": " ",
        "PHOTOLIBRARY_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-file": {},
      "cordova-plugin-geolocation": {
        "GEOLOCATION_USAGE_DESCRIPTION": " "
      },
      "cordova-plugin-x-socialsharing": {},
      "cordova-plugin-statusbar": {},
      "es6-promise-plugin": {},
      "cordova-plugin-facebook4": {

还有我的tsconfig.json:

{

  "compilerOptions": {
    "paths": {
      "@angular/*": ["node_modules/@angular/*"]
    },

    "baseUrl": "src",
    "allowSyntheticDefaultImports": true,
    "declaration": false,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "lib": [
      "dom",
      "es2015"
    ],
    "module": "es2015",
    "moduleResolution": "node",
    "sourceMap": true,
    "target": "es5"
  },

  "include": [
    "src/**/*.ts",

  ],
  "exclude": [
    "node_modules",
    "src/**/*.spec.ts",
    "src/**/__tests__/*.ts"
  ],
  "compileOnSave": false,
  "atom": {
    "rewriteTsconfig": false
  }


}

【问题讨论】:

    标签: angular firebase ionic-framework ionic3


    【解决方案1】:

    尝试删除您的 node_modules 文件夹,然后重新安装它们以查看错误是否消失。

    rm -rf node_modules
    npm install
    

    您的错误到处都是,因此很难确定是什么原因造成的。我将假设导致此问题的原因是许多不同的问题,而不是一个本地化问题。

    【讨论】:

    • 可能是您使用 Angular 6.x.x 的问题。尝试降级到 Angular 5.x.x
    【解决方案2】:

    尝试在您的文件夹项目上运行 npm rebuild 以重建您的插件

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-02-22
      • 2021-04-07
      • 2020-05-30
      • 2019-02-21
      • 2016-10-19
      • 1970-01-01
      • 2017-07-20
      相关资源
      最近更新 更多