# Cant install cakephp 4

**URL:** <https://discourse.cakephp.org/t/cant-install-cakephp-4/8755>\
**Category:** Uncategorized\
**Created:** [December 19, 2020, 8:18am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755 "2020-12-19T08:18:49Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![jagguy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jagguy](https://discourse.cakephp.org/u/jagguy)\
**Post date:** [December 19, 2020, 8:18am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/1 "2020-12-19T08:18:49Z")

</div>

I have wamp64 /win10 and downloaded cakephp 3.9.\* and it worked fine. I have php 7.4

I have composer and ran commands from www folder

I tried to download cakephp 4 and kept getting this error in my console

_could not find package cakephp/app with version 4._ in a version installable with your php version, php extension and composer version\*

All these commands got the same error  
composer self-update && composer create-project --prefer-dist cakephp/app:4.0.\* crm4  
composer create-project --prefer-dist “cakephp/app:^4.0” crm4

i cant install cakephp 4

---

<div class="post-metadata">

**Author:** ![jimgwhit](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jimgwhit/32/378_2.png) [@jimgwhit](https://discourse.cakephp.org/u/jimgwhit)\
**Post date:** [December 20, 2020, 9:23pm UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/2 "2020-12-20T21:23:35Z")

</div>

I just installed 4.2.0-RC1 no problems. Make sure your composer.json is correct.

A version of app has to work with a version of framework (vendor stuff).

---

<div class="post-metadata">

**Author:** ![jagguy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jagguy](https://discourse.cakephp.org/u/jagguy)\
**Post date:** [December 22, 2020, 1:20am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/4 "2020-12-22T01:20:26Z")

</div>

The installation now cuts out towards the end with this error

composer create-project --prefer-dist cakephp/app:~4.0 my\_app\_name

```auto
handing the post create project cmd event terminated with an exception and some Symfony runtime exception when you get to the set folder permission y/n 

```

the json file is

```auto
{
    "name": "cakephp/app",
    "description": "CakePHP skeleton app",
    "homepage": "https://cakephp.org",
    "type": "project",
    "license": "MIT",
    "require": {
        "php": ">=7.2",
        "cakephp/cakephp": "~4.2.0",
        "cakephp/migrations": "^3.0",
        "cakephp/plugin-installer": "^1.3",
        "mobiledetect/mobiledetectlib": "^2.8"
    },
    "require-dev": {
        "cakephp/bake": "^2.3",
        "cakephp/cakephp-codesniffer": "~4.2.0",
        "cakephp/debug_kit": "^4.4",
        "josegonzalez/dotenv": "^3.2",
        "phpunit/phpunit": "~8.5.0 || ^9.3",
        "psy/psysh": "@stable"
    },
    "suggest": {
        "markstory/asset_compress": "An asset compression plugin which provides file concatenation and a flexible filter system for preprocessing and minification.",
        "dereuromark/cakephp-ide-helper": "After baking your code, this keeps your annotations in sync with the code evolving from there on for maximum IDE and PHPStan/Psalm compatibility.",
        "phpstan/phpstan": "PHPStan focuses on finding errors in your code without actually running it. It catches whole classes of bugs even before you write tests for the code."
    },
    "autoload": {
        "psr-4": {
            "App\\": "src/"
        }
    },
    "autoload-dev": {
        "psr-4": {
            "App\\Test\\": "tests/",
            "Cake\\Test\\": "vendor/cakephp/cakephp/tests/"
        }
    },
    "scripts": {
        "post-install-cmd": "App\\Console\\Installer::postInstall",
        "post-create-project-cmd": "App\\Console\\Installer::postInstall",
        "check": [
            "@test",
            "@cs-check"
        ],
        "cs-check": "phpcs --colors -p src/ tests/",
        "cs-fix": "phpcbf --colors -p src/ tests/",
        "stan": "phpstan analyse",
        "test": "phpunit --colors=always"
    },
    "prefer-stable": true,
    "config": {
        "sort-packages": true
    }
}

```

---

<div class="post-metadata">

**Author:** ![jimgwhit](https://yyz1.discourse-cdn.com/flex029/user_avatar/discourse.cakephp.org/jimgwhit/32/378_2.png) [@jimgwhit](https://discourse.cakephp.org/u/jimgwhit)\
**Post date:** [December 24, 2020, 12:18am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/5 "2020-12-24T00:18:01Z")

</div>

If you continue having trouble, go here:

> **[cakephp/app](https://github.com/cakephp/app/tags)**
>
> CakePHP application template. Contribute to cakephp/app development by creating an account on GitHub.

Download [4.2.1](https://github.com/cakephp/app/releases/tag/4.2.1)

Extract in correct folder

run composer install

manually make a logs folder and give permissions.

That’s how I normally install anyway.

I just tested by doing a new install, all went good.

Or in above line:

```auto
composer create-project --prefer-dist cakephp/app:~4.0 my_app_name

```

Try changing to

```auto
composer create-project --prefer-dist cakephp/app:~4.2 my_app_name

```

I did not try that yet.

---

<div class="post-metadata">

**Author:** ![hala0409](https://avatars.discourse-cdn.com/v4/letter/h/f0a364/32.png) [@hala0409](https://discourse.cakephp.org/u/hala0409)\
**Post date:** [December 24, 2020, 6:17am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/6 "2020-12-24T06:17:40Z")

</div>

hey @jagguy  
maybe you entering the wrong command for installing a cakephp because here is the syntax of your command:  
_composer self-update && composer create-project --prefer-dist cakephp/app:4.0._ crm4  
_ **composer create-project --prefer-dist “cakephp/app:^4.0” crm4** _  
and here is the right syntax from the official site that is different from your commands :  
**composer create-project --prefer-dist cakephp/app:~4.0 my\_app\_name**

---

<div class="post-metadata">

**Author:** ![jagguy](https://avatars.discourse-cdn.com/v4/letter/j/b487fb/32.png) [@jagguy](https://discourse.cakephp.org/u/jagguy)\
**Post date:** [December 29, 2020, 8:57am UTC](https://discourse.cakephp.org/t/cant-install-cakephp-4/8755/7 "2020-12-29T08:57:48Z")

</div>

i just needed to create the install folder first, simple fix
