【问题标题】:Using Ionic3 code with Ionic4 version installed - without migrating使用安装了 Ionic4 版本的 Ionic3 代码 - 无需迁移
【发布时间】:2019-09-30 17:44:28
【问题描述】:

我还没有将我的 Ionic3 应用程序迁移到 Ionic4,并继续使用我在 Ionic4 发布之前安装的最后一个 Ionic3 版本 (3.20)。我假设为了使用 Ionic4,代码本身必须与 Ionic4 带来的所有更改兼容——新的项目结构/文件夹、安装 Angular 6 及更高版本、更改组件和函数名称等等。 最近通过npm install -g ionic 意外安装了最新的Ionic4 版本后,我在Ionic3 项目上做了一个干净的npm install,没有更改package.json 中的任何内容,在ionic serve 之后,Ionic3 应用程序似乎运行没有任何问题。 我没有从 Ionic 看到任何有关此问题或向后兼容性支持的官方信息 - 可以继续使用 Ionic3 代码并安装 Ionic4 版本吗?还是有其他原因?

package.json


  "scripts": {
    "clean": "ionic-app-scripts clean",
    "build": "ionic-app-scripts build",
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/animations": "5.0.3",
    "@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",
    "@angular/platform-server": "5.0.3",
    "angularfire2": "4.0.0-rc.1",
    "es6-promise-plugin": "^4.2.2",
    "firebase": "4.4.0",
    "ionic-angular": "^3.9.3",
    "moment": "^2.22.2",
    "promise-polyfill": "6.1.0",
    "rxjs": "5.5.2",
    "sw-toolbox": "^3.6.0",
    "zone.js": "0.8.18"
  },
  "devDependencies": {
    "@ionic/app-scripts": "^3.2.3",
    "typescript": "2.4.2"
  }
}

还有离子版本

【问题讨论】:

    标签: ionic3 ionic4


    【解决方案1】:

    如果您运行ionic info,您将在项目中看到您当前的 CLI 版本和当前框架版本。因此,您的全局 Ionic CLI 可以是 4.12.0,并且您仍然可以在项目中运行 ionic 3,只要框架为 3~。

    离子信息:

    【讨论】:

      猜你喜欢
      • 2020-12-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-10-11
      • 1970-01-01
      • 2020-01-04
      • 2020-03-25
      相关资源
      最近更新 更多