简体   繁体   English

如何从ionic3迁移到ionic2以及如何从ionic2迁移回ionic3

[英]how to migrate from ionic3 to ionic2 and also from ionic2 back to ionic3

I want to know how to exchange between ionic 3 and 2 or 2 to 3 with keep same project 我想知道如何在保持相同项目的情况下在离子3与2或2与3之间进行交换

im use WINDOWS. 我使用WINDOWS。 in the first time, I install 第一次安装

npm install -g ionic Cordova

and for starting a new project i insert like following docs in ionicframework.com : 为了启动一个新项目,我在ionicframework.com中插入了以下文档:

ionic start [myproject] blank

and

 cd [myproject]
 ionic serve

i don't know what the version ionic was installed? 我不知道安装了什么版本的ionic? is the latest version by default or what? 默认情况下是最新版本还是什么? because of this article here : https://www.joshmorony.com/using-http-to-fetch-remote-data-from-a-server-in-ionic-2/ 因为这里的这篇文章: https : //www.joshmorony.com/using-http-to-fetch-remote-data-from-a-server-in-ionic-2/

tell should install v2 in the first time and then we want to move to 3 !! 告诉应该在第一时间安装v2,然后我们要移至3!

and I want to know how can moving between the version 2>>3 or 3>>2 without any crash. 我想知道如何在版本2 >> 3或3 >> 2之间切换而不会崩溃。 and I'm afraid if I'm using v3 by default and give something wrong while coding 而且我担心如果我默认使用v3并在编码时出现错误

plizzz someone explain carefully my issue 有人仔细解释我的问题

what you can do is to use a node version manager or nvm for short, which would let you handle different versions of node. 您可以做的是使用节点版本管理器或简称nvm,这将使您可以处理不同版本的节点。 By having different versions of node you can have ionic 3 on node XX version and ionic 2 in a different one. 通过使用不同版本的节点,可以在节点XX版本上具有ionic 3,而在不同版本中具有ionic 2。

since you are using windows you can use this one . 因为你使用的是Windows,你可以使用此一个

You can type in your console 'ionic info' and then you will see all info from your project. 您可以在控制台中输入“离子信息”,然后您将看到项目中的所有信息。 Sample output, from my environment: 来自我的环境的样本输出:

global packages:

    @ionic/cli-utils : 1.4.0
    Cordova CLI      : 6.3.1 
    Ionic CLI        : 3.4.0

local packages:

    @ionic/app-scripts              : 1.3.7
    @ionic/cli-plugin-cordova       : 1.4.0
    @ionic/cli-plugin-ionic-angular : 1.3.1
    Cordova Platforms               : android 6.1.2 browser 4.1.0
    Ionic Framework                 : ionic-angular 3.5.0

System:

    Node       : v7.4.0
    OS         : Linux 4.4
    Xcode      : not installed
    ios-deploy : not installed
    ios-sim    : not installed
    npm        : 5.0.3 

You have to pay attention that there are differences between what is installed globally and what is local. 您必须注意,全局安装的内容和本地安装的内容之间存在差异。 Globally you should have ionic-cli, which is the command line tool used to manage Ionics' project (either 1, 2, or 3). 在全球范围内,您应该拥有ionic-cli,这是用于管理Ionics项目(1、2或3)的命令行工具。

The version of the framework you are using is the Ionic Framework, installed locally, and managed by npm (via package.json, the package is called 'ionic-framework'). 您正在使用的框架版本是Ionic框架,该框架在本地安装并由npm管理(通过package.json,该软件包称为“ ionic-framework”)。 So, do change dependencies, you should only change the package.json from your project. 因此,要更改依赖项,只应从项目中更改package.json。 You must pay attention, too, that each ionic-framework version has its own dependencies versions, specially from @angular (example: ionic-framework v2 uses angular2, ionic-framework v3 uses angular4). 您还必须注意,每个ionic-framework版本都有其自己的依赖项版本,特别是@angular中的版本(例如:ionic-framework v2使用angular2,ionic-framework v3使用angular4)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM