将Ionic 2.0.0-beta.20升级到最新版本

时间:2016-12-07 12:16:07

标签: ionic2

我有一个现有的应用程序,我使用Ionic 2.0.0-beta.20在Windows / Android上构建。我无法获得任何Ionic 2.0.0-beta.20个应用,包括vanilla(ionic start)可以在OSX上运行。因此,我认为我需要从Ionic 2.0.0-beta.20升级到最新版本的Ionic 2.

有人可以推荐这么好的指南吗?

我担心我破坏了现有的应用程序,因为我知道最新版本中的某些结构发生了变化。

感谢。

更新

我跑:

npm install -g ionic

希望它升级到最新版的Ionic。

如下所示,Ionic App Lib Version: 2.1.7是最新的。但为什么它仍然有:Ionic Framework Version: 2.0.0-beta.11,这是框架的最新版本吗?

Your system information:

 ordova CLI: 6.4.0
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.2.2
Xcode version: Not installed

更新

现在我的Windows环境尝试升级Ionic时出错。任何建议表示赞赏:

E:\Development\IDE\ionic-apps\theWhoZoo>ionic info
******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

Your system information:

Cordova CLI: Not installed
Ionic Framework Version: 2.0.0-beta.11
Ionic CLI Version: 2.1.14
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v6.2.2
Xcode version: Not installed


******************************************************
 Dependency warning - for the CLI to run correctly,
 it is highly recommended to install/upgrade the following:

 Please install your Cordova CLI to version  >=4.2.0 `npm install -g cordova`

******************************************************

E:\Development\IDE\ionic-apps\theWhoZoo>npm install -g cordova
npm WARN deprecated node-uuid@1.4.7: use uuid module instead
C:\Users\Richard\AppData\Roaming\npm
`-- (empty)

npm ERR! Windows_NT 10.0.14393
npm ERR! argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\Richard\\AppData\\Roaming\\npm\\node_modules\\npm\\bin\\npm-cli.js" "install" "-g" "cordova"
npm ERR! node v6.2.2
npm ERR! npm  v4.0.3
npm ERR! path C:\Users\Richard\AppData\Roaming\npm\node_modules\.staging\abbrev-fda00e1c
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall rename

npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Richard\AppData\Roaming\npm\node_modules\.staging\abbrev-fda00e1c' -> 'C:\Users\Richard\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
npm ERR! enoent ENOENT: no such file or directory, rename 'C:\Users\Richard\AppData\Roaming\npm\node_modules\.staging\abbrev-fda00e1c' -> 'C:\Users\Richard\AppData\Roaming\npm\node_modules\cordova\node_modules\npm\node_modules\abbrev'
npm ERR! enoent This is most likely not a problem with npm itself
npm ERR! enoent and is related to npm not being able to find a file.
npm ERR! enoent

npm ERR! Please include the following file with any support request:
npm ERR!     E:\Development\IDE\ionic-apps\theWhoZoo\npm-debug.log

1 个答案:

答案 0 :(得分:4)

最佳做法可能是创建一个包含最新版本的空白项目,然后将代码复制并粘贴到那里。在您这样做之前,请阅读这些发布说明(告诉您ngModule和所有其他更改)https://github.com/driftyco/ionic/blob/master/CHANGELOG.md#user-content-200-rc0-2016-09-28

因为RC.0没有什么变化。但是在一切正常工作之前,升级到RC.0是相当多的试验和错误。 (f.e. <ion-navbar primary>成为<ion-navbar color="primary">

仔细阅读它们,如果您了解更改了一些内容,将页面复制并粘贴到src文件夹中,请更新ngModule并将代码更改为发行说明。

(我会首先尝试为你的空白项目提供服务,如果失败了,那么离子cli(可能是双重安装)会出现问题,但这可能会让你不再认为你的项目被严重更新而不是你的cli被窃听)

修改

我自己的版本:(适用于最新的RC.3

$ ionic info

 ordova CLI: 6.4.0
Ionic CLI Version: 2.1.13
Ionic App Lib Version: 2.1.7
ios-deploy version: Not installed
ios-sim version: Not installed
OS: Windows 10
Node Version: v4.5.0
Xcode version: Not installed