# Can I create an ionic v4 project with the latest CLI

**URL:** <https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589>\
**Category:** Ionic Angular\
**Created:** [April 18, 2020, 8:53pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589 "2020-04-18T20:53:48Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![sebastienguillon1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebastienguillon1/32/109774_2.png) [@sebastienguillon1](https://forum.ionicframework.com/u/sebastienguillon1)\
**Post date:** [April 18, 2020, 8:53pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/1 "2020-04-18T20:53:49Z")

</div>

I would like to replicate an ionic 4 project without most of the dependencies to do some tests. So I need to create a blank Ionic 4 project with @ionic/angular v4.11.8.

How can I do this with the latest ionic CLI, or any other version?

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [April 18, 2020, 10:06pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/2 "2020-04-18T22:06:10Z")

</div>

By manually editing `package.json` once the project has been spawned.

---

<div class="post-metadata">

**Author:** ![sebastienguillon1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebastienguillon1/32/109774_2.png) [@sebastienguillon1](https://forum.ionicframework.com/u/sebastienguillon1)\
**Post date:** [April 19, 2020, 9:51am UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/3 "2020-04-19T09:51:53Z")

</div>

@rapropos, here are my concerns about that solution :  
Even if I follow my existing project’s package.json, I wouldn’t end up with all the generated files the same way they were generated for an Ionic v4 project.  
Would that not matter?

Pushing the question further (not my exact use case) : the current Ionic CLi generates an Angular 8 project while I might need an Ionic 4 project with Angular 7.

---

<div class="post-metadata">

**Author:** ![rapropos](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/rapropos/32/100227_2.png) [@rapropos](https://forum.ionicframework.com/u/rapropos)\
**Post date:** [April 19, 2020, 6:14pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/4 "2020-04-19T18:14:48Z")

</div>

> [@sebastienguillon1](#):
>
> Even if I follow my existing project’s package.json, I wouldn’t end up with all the generated files the same way they were generated for an Ionic v4 project.

I don’t believe “the way they were generated for an Ionic v4 project” is as static of a thing as you apparently do. Node dependencies are a quite complex snarl of many moving targets, so…

> [@sebastienguillon1](#):
>
> the current Ionic CLi generates an Angular 8 project while I might need an Ionic 4 project with Angular 7.

You can edit `package.json` to pin whatever version of dependencies you desire. Agreed, it’s going to be some work to get a set that’s all internally compatible from scratch, but I thought from your OP that you had some sort of archetypal project you were trying to “replicate”, so you could use that `package.json` as a reference.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [April 20, 2020, 5:08pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/5 "2020-04-20T17:08:09Z")

</div>

@sebastienguillon1 you are misunderstanding the purpose of framework versions.

You can’t start a new project with v4 because it’s not the stable release version.  
You should update your projects deps to use the latest versions of packages.

---

<div class="post-metadata">

**Author:** ![sebastienguillon1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebastienguillon1/32/109774_2.png) [@sebastienguillon1](https://forum.ionicframework.com/u/sebastienguillon1)\
**Post date:** [April 21, 2020, 12:57pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/6 "2020-04-21T12:57:59Z")

</div>

@mhartington  
Here is the long version:

I have a project (not all done by me, by a team) with Authentication, somewhat complex routing and a lot of native code (Capacitor project).

I wanted to test some basic Angular components using animations and the Ionic 4 Gestures which are available in our Ionic v4 project.

To do that I thought it would be much quicker to work in a lightweight Ionic project, but I also wanted to make sure I’m not using Ionic 5 Gestures or Anything different from our project.

So as I understand from @rapropos 's answer, I need to create a new project with the current CLI and update all the relevant dependencies from the package.json.

---

<div class="post-metadata">

**Author:** ![mhartington](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/mhartington/32/137757_2.png) [@mhartington](https://forum.ionicframework.com/u/mhartington)\
**Post date:** [April 21, 2020, 3:13pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/7 "2020-04-21T15:13:24Z")

</div>

You don’t understand. Ionic 4 didnt expose the gesture API, so you can’t really use it.  
In V5, the gesture API is the same as V4, just publicly exposed.

---

<div class="post-metadata">

**Author:** ![sebastienguillon1](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/sebastienguillon1/32/109774_2.png) [@sebastienguillon1](https://forum.ionicframework.com/u/sebastienguillon1)\
**Post date:** [April 21, 2020, 5:26pm UTC](https://forum.ionicframework.com/t/can-i-create-an-ionic-v4-project-with-the-latest-cli/187589/8 "2020-04-21T17:26:06Z")

</div>

@mhartington  
I might be missing something, but this works fine :

```auto
import { createGesture, Gesture, GestureDetail } from '@ionic/core';

...

const bannerGesture: Gesture = createGesture({
    el: this.bannerRef.nativeElement,
    disableScroll: true,
    direction: 'y',
    gesturePriority: 10,
    threshold: 1,
    gestureName: 'banner-gesture',
    onMove: this.onGestureMoveHandler.bind(this),
});
bannerGesture.setDisabled(false);

```

Using @ionic/angular@4.11.8
