如何将现有的ionic2项目更新到ionic2 CLI的2.1.18版

时间:2017-01-04 09:08:49

标签: angular ionic2

我已经将ionic2 CLI从2.1.17更新到2.1.18,那么我应该如何升级我使用2.1.17版本构建的现有项目。

这是离子信息详情 - 您的系统信息:

Cordova CLI:6.4.0 离子CLI版本:2.1.18 Ionic App Lib版本:2.1.9 ios-deploy版本:未安装 ios-sim版:未安装 操作系统:Linux 4.4 节点版本:v6.9.2 Xcode版本:未安装

的package.json

{
  "name": "ionic-hello-world",
  "author": "Ionic Framework",
  "homepage": "http://ionicframework.com/",
  "private": true,
  "scripts": {
    "ionic:build": "ionic-app-scripts build",
    "ionic:serve": "ionic-app-scripts serve"
  },
  "dependencies": {
    "@angular/common": "2.1.1",
    "@angular/compiler": "2.1.1",
    "@angular/compiler-cli": "2.1.1",
    "@angular/core": "2.1.1",
    "@angular/forms": "2.1.1",
    "@angular/http": "2.1.1",
    "@angular/platform-browser": "2.1.1",
    "@angular/platform-browser-dynamic": "2.1.1",
    "@angular/platform-server": "2.1.1",
    "@ionic/storage": "1.1.6",
    "ionic-angular": "2.0.0-rc.3",
    "ionic-native": "2.2.3",
    "ionicons": "3.0.0",
    "rxjs": "5.0.0-beta.12",
    "zone.js": "0.6.26"
  },
  "devDependencies": {
    "@ionic/app-scripts": "0.0.45",
    "typescript": "2.0.6"
  },
  "cordovaPlugins": [
    "cordova-plugin-statusbar",
    "cordova-plugin-device",
    "cordova-plugin-console",
    "cordova-plugin-whitelist",
    "cordova-plugin-splashscreen",
    "ionic-plugin-keyboard"
  ],
  "cordovaPlatforms": [],
  "description": "ionic: An Ionic project"
}

1 个答案:

答案 0 :(得分:4)

您的 Ionic CLI 版本已更新。您的项目位于 Ionic 2 RC3 (基于"ionic-angular": "2.0.0-rc.3",)而不是2.1.7。您当前的项目仍然有效。

如果要将项目升级到当前的RC4版本,最快捷的方法是查看ionic starter template的package.json文件。 相应地更新你的package.json。删除node_modules文件夹。 最后运行

npm install

检查the readme

另一种方法是简单地做, ionic start myApp blank --v2并将src文件夹替换为您的文件夹,并添加您之前项目中的所有其他软件包。