2

In a new folder completely empty :

composer init

i have :

Welcome to the Composer config generator

This command will guide you through creating your composer.json config.

Package name (<vendor>/<name>) [slordef/test-composer]:

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

init [--name NAME] [--description DESCRIPTION] [--author AUTHOR] [--type [TYPE]] [--homepage HOMEPAGE] [--require REQUIRE] [--require-dev REQUIRE-DEV] [-s|--stability STABILITY] [-l|--license LICENSE] [--repository REPOSITORY]

Composer is up to date... Dont know how it append

1
  • try running that command by adding -vvv to get debug output e.g: composer init -vvv Commented Apr 2, 2020 at 17:52

4 Answers 4

2

This is probably a problem with PHP version 7.4, had to switch to version 7.3 to make it work

Sign up to request clarification or add additional context in comments.

2 Comments

This solution fixes in my case, thank you.
I am using PHP 7.3.12 of wampserver 3 but still got that problem. Any ideas?
0

by running :

composer init -vvv

get :

Exception trace: () 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 phar://C:/ProgramData/ComposerSetup/bin/composer.phar/src/Composer/Command/InitCommand.php:240 Composer\Command\InitCommand->interact() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/vendor/symfony/console/Command/Command.php:230 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:267 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:106 Composer\Console\Application->run() at phar://C:/ProgramData/ComposerSetup/bin/composer.phar/bin/composer:61 require() at C:\ProgramData\ComposerSetup\bin\composer.phar:24

Comments

0

Uninstall and reinstall Composer. Note that when installing, set php version 7.0. * To environment variables. So your problem will be solved

1 Comment

Why 7.0.*? Why not 7.4.*? Giving an example of what that looks would be helpful.
0

i had the same bug, but I after all I realized that it happens in the last version of php. Example: I am now using PHP 7.4 but when I switched to PHP 7.3.12 the bug was solved! So I could dare saying that for that specific bug the first thing to check is the version of PHP you're using whether is it stable of not..

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.