Cakephp 4 Windows Installation Issues

杀马特。学长 韩版系。学妹 提交于 2021-01-29 22:33:57

问题


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

回答1:


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.



来源:https://stackoverflow.com/questions/61196192/cakephp-4-windows-installation-issues

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!