0

I am running into composer/installation errrors on wamp64 setup on Windows 10... had this working previously on older app but now starting new app on 4.0.3 and running into dependency issues

Below is output - Any thoughts on why it's not finding any matching packages? the "myapp" folder is created and cakephp source is copied but then a number of dependencies show "no matching package found"

Can these packages be ignored? some, such as migrations fall under "require" in the composer.json I have tried both the below command and composer create-project --prefer-dist "cakephp/app:^4.0" myapp

C:\wamp64\www>composer create-project --prefer-dist cakephp/app myapp
Creating a "cakephp/app" project at "./myapp"
Installing cakephp/app (4.0.3)
  - Installing cakephp/app (4.0.3): Loading from cache
Created project in G:\Websites\www\myapp
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.

  Problem 1
    - cakephp/migrations 3.0.0-beta2 requires robmorgan/phinx 0.next-dev -> no matching package found.
    - cakephp/cakephp 4.0.0-beta4 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-beta3 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-beta2 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-beta1 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-alpha2 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-alpha1 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/cakephp 4.0.0-RC1 requires cakephp/chronos 2.x-dev as 2.0.0 -> no matching package found.
    - cakephp/migrations 3.0.0-beta1 requires robmorgan/phinx 0.11.x-dev -> satisfiable by robmorgan/phinx[0.11.x-dev].
    - Conclusion: don't install cakephp/cakephp 4.0.5
    - Conclusion: don't install cakephp/cakephp 4.0.4
    - Conclusion: don't install cakephp/cakephp 4.0.3
    - Conclusion: don't install cakephp/cakephp 4.0.2
    - Installation request for cakephp/migrations ^3.0 -> satisfiable by cakephp/migrations[3.0.0-beta1, 3.0.0-beta2].
    - Conclusion: don't install cakephp/cakephp 4.0.1
    - Conclusion: don't install cakephp/cakephp 4.0.0
    - robmorgan/phinx 0.11.x-dev requires cakephp/database ^3.7 -> satisfiable by cakephp/database[3.7.0, 3.7.0-RC1, 3.7.0-RC2, 3.7.0-RC3, 3.7.0-beta1, 3.7.1, 3.7.2, 3.7.3, 3.7.4, 3.7.5, 3.7.6, 3.7.7, 3.7.8, 3.7.9, 3.8.0, 3.8.0-RC1, 3.8.0-RC2, 3.8.0-RC3, 3.8.0-beta1, 3.8.1, 3.8.10, 3.8.11, 3.8.2, 3.8.3, 3.8.4, 3.8.5, 3.8.6, 3.8.7, 3.8.8, 3.8.9, 3.x-dev].
    - don't install cakephp/database 3.7.0|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.0-RC1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.0-RC2|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.0-RC3|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.0-beta1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.2|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.3|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.4|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.5|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.6|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.7|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.8|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.7.9|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.0|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.0-RC1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.0-RC2|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.0-RC3|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.0-beta1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.1|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.10|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.11|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.2|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.3|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.4|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.5|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.6|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.7|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.8|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.8.9|don't install cakephp/cakephp 4.0.0-RC2
    - don't install cakephp/database 3.x-dev|don't install cakephp/cakephp 4.0.0-RC2
    - Installation request for cakephp/cakephp ^4.0 -> satisfiable by cakephp/cakephp[4.0.0, 4.0.0-RC1, 4.0.0-RC2, 4.0.0-alpha1, 4.0.0-alpha2, 4.0.0-beta1, 4.0.0-beta2, 4.0.0-beta3, 4.0.0-beta4, 4.0.1, 4.0.2, 4.0.3, 4.0.4, 4.0.5].

Potential causes:
 - A typo in the package name
 - The package is not available in a stable-enough version according to your minimum-stability setting
   see <https://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
 - It's a private package and you forgot to add a custom repository to find it

Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.

After fix, receive this message on post-load scripts

   psy/psysh suggests installing hoa/console (A pure PHP readline implementation. You'll want this if your PHP install doesn't already support readline or libedit.)
    Writing lock file
    Generating autoload files
    > Cake\Composer\Installer\PluginInstaller::postAutoloadDump
    7 packages you are using are looking for funding.
    Use the `composer fund` command to find out more!
    > App\Console\Installer::postInstall
    Created `config/app_local.php` file
    Created `G:\Websites\www\myapp/logs` directory
    Created `G:\Websites\www\myapp/tmp/cache/views` directory
    Set Folder Permissions ? (Default to Y) [Y,n]? Script App\Console\Installer::postInstall handling the post-create-project-cmd event terminated with an exception


      [Symfony\Component\Console\Exception\RuntimeException]
      Aborted

Exception trace:

Created `G:\Websites\www\myapp/tmp/cache/views` directory
Set Folder Permissions ? (Default to Y) [Y,n]? Script App\Console\Installer::postInstall handling the post-create-project-cmd event terminated with an exception

  [Symfony\Component\Console\Exception\RuntimeException]
  Aborted

() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:148
 Symfony\Component\Console\Helper\QuestionHelper->doAsk() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:75
 Symfony\Component\Console\Helper\QuestionHelper->Symfony\Component\Console\Helper\{closure}() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:404
 Symfony\Component\Console\Helper\QuestionHelper->validateAttempts() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Helper/QuestionHelper.php:78
 Symfony\Component\Console\Helper\QuestionHelper->ask() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/IO/ConsoleIO.php:291
 Composer\IO\ConsoleIO->askAndValidate() at G:\Websites\www\myapp\src\Console\Installer.php:130
 App\Console\Installer::setFolderPermissions() at G:\Websites\www\myapp\src\Console\Installer.php:63
 App\Console\Installer::postInstall() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:305
 Composer\EventDispatcher\EventDispatcher->executeEventPhpScript() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:209
 Composer\EventDispatcher\EventDispatcher->doDispatch() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/EventDispatcher/EventDispatcher.php:96
 Composer\EventDispatcher\EventDispatcher->dispatchScript() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:267
 Composer\Command\CreateProjectCommand->installProject() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/CreateProjectCommand.php:147
 Composer\Command\CreateProjectCommand->execute() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Command/Command.php:245
 Symfony\Component\Console\Command\Command->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:835
 Symfony\Component\Console\Application->doRunCommand() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:185
 Symfony\Component\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:281
 Composer\Console\Application->doRun() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Application.php:117
 Symfony\Component\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Console/Application.php:113
 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:61
 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24
mk97
  • 264
  • 1
  • 6
  • 15
  • 1
    This [**should be fixed now**](https://github.com/cakephp/migrations/issues/448), please try again. – ndm Apr 14 '20 at 08:44
  • @ndm,. thanks this worked now... I get error in the post-install scripts but imagine that is not a show stopper as it has to do with file permissions? > App\Console\Installer::postInstall Created `config/app_local.php` file Created `G:\Websites\www\myapp/logs` directory Created `G:\Websites\www\myapp/tmp/cache/views` directory Set Folder Permissions ? (Default to Y) [Y,n]? Script App\Console\Installer::postInstall handling the post-create-project-cmd event terminated with an exception [Symfony\Component\Console\Exception\RuntimeException] Aborted – mk97 Apr 14 '20 at 16:03
  • updated original question with the message formatted for easier reading – mk97 Apr 14 '20 at 16:05
  • It's not only permissions, it's local application config creation, logs and temp folder creation, folder permissions, and security salt generation. To figure where exactly things go wrong, run the install command (or project creation command if you want to start from scratch) in verbose mode (add `-v`) to see a stacktrace for the error: `composer install -v`. – ndm Apr 14 '20 at 16:28
  • Thanks, exception trace added – mk97 Apr 14 '20 at 17:29
  • Not sure I follow what's happening, The composer install not allowing reponse to "Set Folder Permissions ? " question, simply throws the exception. This was working when I installed for 4.0.1 back in January on same setup (wamp64 running php 7.4) – mk97 Apr 14 '20 at 17:53
  • OK found the issue.. Turns out there's a bug w/ stdin for php 7.4.0 which I was using.. [composer issue log](https://github.com/composer/composer/issues/8457) and also another on [stackoverflow](https://stackoverflow.com/questions/59092779/has-php-7-4-broken-fgetsstdin). Reverting to php 7.3.12 and composer installer goes through w/o issue. I must have built my last project on 7.3.12. Thx for help – mk97 Apr 14 '20 at 19:38

2 Answers2

0

Installation issues turned out to be combination of things. First appears to be a reference to old package in cakephp's composer.json as noted by ndm here

second issue was due to issue with php 7.4.0 and the STNDIN not allowing for a response and throwing exception from composer as noted here and on stack overflow

Thanks for comments to help troubleshoot.

mk97
  • 264
  • 1
  • 6
  • 15
0

if you're considering running CakePHP4.4.4 on a windows 10 PC, you can check out this guide see the URL below

https://github.com/robinsondominic/cakephp4.4.4 This was helpful in setting it up to run with IIS Express using VSCode.

iamdeed
  • 354
  • 4
  • 19