# How to create a project in Ionic v4

**URL:** <https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623>\
**Category:** ionic-v3\
**Created:** [April 23, 2018, 6:26am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623 "2018-04-23T06:26:43Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![almighty99](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@almighty99](https://forum.ionicframework.com/u/almighty99)\
**Post date:** [April 23, 2018, 6:26am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/1 "2018-04-23T06:26:43Z")

</div>

I want to start playing with new Ionic v4. What do I have to do create a new project in it.

I have updated the global install by doing `npm install -g ionic@4.0.0-rc.5`.

So now if I do `ionic -v` I get `4.0.0-rc.5`.

When I create a new project with New cli installed by doing `ionic start newproj blank` I get the following in my package.json.

```auto
  "dependencies": {
    "@angular/animations": "5.2.10",
    "@angular/common": "5.2.10",
    "@angular/compiler": "5.2.10",
    "@angular/compiler-cli": "5.2.10",
    "@angular/core": "5.2.10",
    "@angular/forms": "5.2.10",
    "@angular/http": "5.2.10",
    "@angular/platform-browser": "5.2.10",
    "@angular/platform-browser-dynamic": "5.2.10",
    "@ionic-native/core": "4.7.0",
    "@ionic-native/splash-screen": "4.7.0",
    "@ionic-native/status-bar": "4.7.0",
    "@ionic/storage": "2.1.3",
    "ionic-angular": "3.9.2",
    "ionicons": "3.0.0",
    "rxjs": "5.5.10",
    "sw-toolbox": "3.6.0",
    "zone.js": "0.8.26"
  }

```

Note that `"ionic-angular": "3.9.2",`

Thanks

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [April 23, 2018, 8:16am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/2 "2018-04-23T08:16:39Z")

</div>

Never tried it but spontaneously I would say, to create a new project v4 with `start`, maybe you should also use the upcoming `ionic cli`?

> **[ionic-team/ionic-cli](https://github.com/ionic-team/ionic-cli)**
>
> ionic-cli - The Ionic Command Line Utility

See readme

```
👋 👉 Please test ✨ CLI 4 ✨ release candidates: npm i -g ionic@rc ❤️
master (alpha): npm install -g ionic@canary
3.x (stable): npm install -g ionic (recommended) 

```

but like I said, never tried, just a thought

---

<div class="post-metadata">

**Author:** ![almighty99](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@almighty99](https://forum.ionicframework.com/u/almighty99)\
**Post date:** [April 23, 2018, 2:09pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/3 "2018-04-23T14:09:49Z")

</div>

I have the latest CLI and using start does not give a v4 project. What am I missing here. Can you give it a try and let me know. Thanks.

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [April 23, 2018, 2:15pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/4 "2018-04-23T14:15:32Z")

</div>

Unfortunally I will not have the time ☹ Hope someone could help you

In anycase, you could `start` the project, then update manually `package.json` and then remove `package-lock.json` and `node_modules` and then `npm install` and that should do it too

---

<div class="post-metadata">

**Author:** ![daytonjallen](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@daytonjallen](https://forum.ionicframework.com/u/daytonjallen)\
**Post date:** [April 23, 2018, 3:32pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/5 "2018-04-23T15:32:44Z")

</div>

After you install the rc version of the ionic-cli then you’ll have to run  
`ionic config set -g features.project-angular true` to enable ionic angular 4 projects. After you enable that flag just run `ionic start` and you should see the new `angular` project template.

---

<div class="post-metadata">

**Author:** ![almighty99](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@almighty99](https://forum.ionicframework.com/u/almighty99)\
**Post date:** [April 26, 2018, 3:24am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/6 "2018-04-26T03:24:04Z")

</div>

> [@daytonjallen](#):
>
> u install the rc version of the io

Any documentation on this?

---

<div class="post-metadata">

**Author:** ![almighty99](https://avatars.discourse-cdn.com/v4/letter/a/85e7bf/32.png) [@almighty99](https://forum.ionicframework.com/u/almighty99)\
**Post date:** [April 26, 2018, 3:42am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/7 "2018-04-26T03:42:27Z")

</div>

I was able to get it working and now the project compiles. But as soon as i do `ionic serve` i get the following in the browsers

`Cannot GET /`

in the console I get

```auto
Content Security Policy: The page’s settings blocked the loading of a resource at self (“default-src”).

Content Security Policy: The page’s settings blocked the loading of a resource at self (“default-src”). Source: window.klTabId_kis = 'firefox.tab.b7c1db....

Content Security Policy: The page’s settings blocked the loading of a resource at data:font/woff;base64,d09GRgABAAAAAI7kAB... (“default-src”).

```

How do I solve this?

---

<div class="post-metadata">

**Author:** ![daytonjallen](https://avatars.discourse-cdn.com/v4/letter/d/e99b99/32.png) [@daytonjallen](https://forum.ionicframework.com/u/daytonjallen)\
**Post date:** [April 30, 2018, 3:23pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/8 "2018-04-30T15:23:11Z")

</div>

Not sure, I’ve never seen that error before. How did you go about setting up the project?

---

<div class="post-metadata">

**Author:** ![GameAppsBD](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gameappsbd/32/108315_2.png) [@GameAppsBD](https://forum.ionicframework.com/u/GameAppsBD)\
**Post date:** [August 19, 2018, 8:44pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/9 "2018-08-19T20:44:26Z")

</div>

## Creating a New Ionic 4 Project

Before you can create a new Ionic 4 project go ahead and install the latest version of Ionic CLI (v4) using the following command from your terminal:

```auto
npm install -g ionic

```

After installing the Ionic CLI 4. You can now run the following command to generate a new Ionic 4 project based on Angular 6:

```auto
ionic start ionic4upgradedemo blank --type=angular

```

Creating a new Ionic 4 project based on Angular is the first step toward migrating your Ionic 3 application to Ionic 4 (with Angular). To generate a project based on Angular we are using `--type=angular` .

---

<div class="post-metadata">

**Author:** ![reedrichards](https://avatars.discourse-cdn.com/v4/letter/r/34f0e0/32.png) [@reedrichards](https://forum.ionicframework.com/u/reedrichards)\
**Post date:** [August 20, 2018, 3:52am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/10 "2018-08-20T03:52:37Z")

</div>

> [@GameAppsBD](#):
>
> npm install -g ionic@rc cordova

That’s wrong I think, no need to install the CLI RC version anymore, the cli v4 was official published

```
 npm install -g ionic

```

---

<div class="post-metadata">

**Author:** ![GameAppsBD](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/gameappsbd/32/108315_2.png) [@GameAppsBD](https://forum.ionicframework.com/u/GameAppsBD)\
**Post date:** [August 20, 2018, 9:25pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/11 "2018-08-20T21:25:28Z")

</div>

Sorry for my Misunderstanding.  
thanks.

---

<div class="post-metadata">

**Author:** ![petebreeves](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/petebreeves/32/122223_2.png) [@petebreeves](https://forum.ionicframework.com/u/petebreeves)\
**Post date:** [September 3, 2018, 10:20am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/12 "2018-09-03T10:20:41Z")

</div>

I was confused by this too, but it seems you have to specify the project type by adding `--type=angular` to the command line.  
You can see all the types with the command :-  
`ionic start --list`  
The default seems to be `ionic-angular` which are the ionic 3 templates.

---

<div class="post-metadata">

**Author:** ![ioclaudio](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/ioclaudio/32/126373_2.png) [@ioclaudio](https://forum.ionicframework.com/u/ioclaudio)\
**Post date:** [October 14, 2018, 3:54pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/13 "2018-10-14T15:54:30Z")

</div>

> [@petebreeves](#):
>
> I was confused by this too, but it seems you have to specify the project type by adding `--type=angular` to the command line.  
> You can see all the types with the command :-  
> `ionic start --list`  
> The default seems to be `ionic-angular` which are the ionic 3 templates.

So…

1. The command  
`ionic start myApp tabs--type=angular`  
creates Ionic 4 project

2. The command:  
`ionic start myApp tabs--type=ionic-angular`  
creates a Ionic 3 project.

Is this right?

---

<div class="post-metadata">

**Author:** ![petebreeves](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/petebreeves/32/122223_2.png) [@petebreeves](https://forum.ionicframework.com/u/petebreeves)\
**Post date:** [October 17, 2018, 9:33am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/14 "2018-10-17T09:33:42Z")

</div>

Yes, that is correct.

---

<div class="post-metadata">

**Author:** ![arulyan](https://avatars.discourse-cdn.com/v4/letter/a/d26b3c/32.png) [@arulyan](https://forum.ionicframework.com/u/arulyan)\
**Post date:** [March 13, 2020, 2:44am UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/15 "2020-03-13T02:44:02Z")

</div>

Is writing `--type=angular` important?

---

<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:** [July 19, 2021, 9:01pm UTC](https://forum.ionicframework.com/t/how-to-create-a-project-in-ionic-v4/128623/16 "2021-07-19T21:01:30Z")

</div>

Closed on July 19, 2021, 9:01pm UTC


