I have two projects, one on Ionic 2.2.3 and another with the last version of Ionic 3. But unfortunately I’m having to uninstall and install a version of Ionic whenever I change the project, because of the incompatibility of the new CLI version.
Is there a more efficient way to switch the IONIC 2 and IONIC 3 versions (including your CLI) without having to uninstall and install them?
Soo there’s some confusion here. ionic 2.2.3 sounds like you’re talking about the CLI, not the framework, ionic-angular.
In this case, the Ionic-cli 3.x version is what you should be using for all your ionic projects. Regardless of what version of the framework you’re using (ionic-angular 2.x or ionic-angular 3.x), the 3.x version of the CLI will work.
Run ionic info with your Ionic v3 CLI in both project directories to get the real framework, ionic-angular, version (and also loads of other useful output).
Guibson@DESKTOP ~/Workspace/servicos (master)
$ ionic serve
? Looks like this is an Ionic Angular project, would you like to install @ionicy
? Looks like this is an Ionic Angular project, would you like to install @ionic
/cli-plugin-ionic-angular and continue? Yes
> npm install --save-dev --save-exact @ionic/cli-plugin-ionic-angular@latest
✔ Running command - done!
Starting app-scripts server: --port 8100 --livereload-port 35729 --address 0.0.0 .0 - Ctrl+C to cancel
TypeError: AppScripts.serve is not a function
Guibson@DESKTOP ~/Workspace/servicos (master)
$ **ionic serve**
Starting app-scripts server: --port 8100 --livereload-port 35729 --address 0.0.0 .0 - Ctrl+C to cancel
**TypeError: AppScripts.serve is not a function**