Search code examples
angularionic-frameworknpmionic3ionic4

How to keep both the ionic 3 and ionic 4 version together in my machine


I am working with ionic 3 version with many apps and it's working fine. Now for my new project, I want to develop in ionic 4 but don't want to uninstall ionic 3. So when I run below command to install ionic 4 locally it throws an error.

Command:

npm install ionic@rc cordova

Error:

npm ERR! code ETARGET
npm ERR! notarget No matching version found for ionic@rc
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/username/.npm/_logs/2019-03-04T09_28_35_725Z-debug.log

How to resolve this issue?


Solution

  • You don't need to have different versions. You only install the global CLI. The CLI works with all versions of the framework.

    eg https://github.com/ionic-team/starters

    run

    ionic start myApp tabs --type ionic1  // for ionic 1    
    ionic start myApp tabs --type ionic-angular // for ionic 2/3    
    ionic start myApp tabs --type angular  // for ionic 4+