1

I have globally installed the latest version of Ionic CLI 4 (4.12.0) by running npm install -g ionic@4.12.0, after that, I created a new Ionic project using ionic start, I opened the project and checked my package.json file :

 "dependencies": {
    "@angular/common": "~9.1.6",
    "@angular/core": "~9.1.6",
    "@angular/forms": "~9.1.6",
    "@angular/platform-browser": "~9.1.6",
    "@angular/platform-browser-dynamic": "~9.1.6",
    "@angular/router": "~9.1.6",
    "@ionic-native/core": "^5.0.7",
    "@ionic-native/splash-screen": "^5.0.0",
    "@ionic-native/status-bar": "^5.0.0",
    "@ionic/angular": "^5.0.0",
    "rxjs": "~6.5.1",
    "tslib": "^1.10.0",
    "zone.js": "~0.10.2"
  }

And as you can see, Ionic version installed is "5". Any suggestions to create Ionic 4 project instead of Ionic 5 project?

ionic --version: 4.12.0.

Thank you.

Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54
MDIT
  • 1,508
  • 5
  • 25
  • 38

2 Answers2

3

If you really want to use Ionic 4, you can install a specific version of any package by adding @[version] after the package name, so in your case for @ionic/angular, you need @ionic/angular@4.11.10.

In your project root, run:

npm i @ionic/angular@4.11.10

(version 4.11.10 is the LTS)

Sébastien
  • 11,860
  • 11
  • 58
  • 78
2

I'm working with ionic for 2 years and as I know, v5 and v4 have no difference in syntax or compatibility so you can use v5 and not worry about a thing.

Mahdi Zarei
  • 5,644
  • 7
  • 24
  • 54