Composer init (new project) Aborted with Symfony RuntimeException - exception

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

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

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

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..

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

Related

Yii2 'Your system does not support any of these drivers: gmagick,imagick,gd2'

The problem is like this : i am following a yii tutorial in order to learn more about the framework, the tutorial is https://www.youtube.com/watch?v=whuIf33v2Ug&t=11365s and i found myself strugalling at 2:55:31 ( thumbnail resize ) , i installed the necesary dependencie using composer require yiisoft/yii2-imagine and i wrote the code.
Image::getImagine()
->open($thumbnailPath)
->thumbnail(new Box(1280, 1280))
->save();
but for some reason i encountered this error and i can't figure out how to resolve it :
"Your system does not support any of these drivers: gmagick,imagick,gd2"
image of the error in question
that one is not a yii2 error. you will need to enable one of that extension in you php.ini
if you are a windows user:
i would suggest to start with gd2 that one does not need any extra installation, only you will need to uncomment following line in your php.ini
extension=gd2
if you are linux user:
sudo apt-get install php-gd
will solve your problem. (you will need root permissions to the system)

The "GenerateDepsFile" task failed unexpectedly

I tried to compile my new application in MonoDevelop and I got this error:
/usr/share/dotnet/sdk/2.2.203/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.Sdk.targets(5,5): Error MSB4018: The "GenerateDepsFile" task failed unexpectedly.
System.TypeLoadException: Could not load type of field 'Microsoft.NET.Build.Tasks.DependencyContextBuilder:_filteredPackages'
(12) due to: Could not resolve type with token 01000027 from typeref
(expected class 'NuGet.Packaging.Core.PackageIdentity' in assembly
'NuGet.Packaging, Version=5.0.0.6, Culture=neutral,
PublicKeyToken=31bf3856ad364e35') assembly:NuGet.Packaging,
Version=5.0.0.6, Culture=neutral, PublicKeyToken=31bf3856ad364e35
type:NuGet.Packaging.Core.PackageIdentity member:(null)
at Microsoft.NET.Build.Tasks.TaskBase.Execute () [0x00000] in :0
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute
() [0x00029] in <58f0218f988743a48dd7c84cbe933f4e>:0
at Microsoft.Build.BackEnd.TaskBuilder.ExecuteInstantiatedTask (Microsoft.Build.BackEnd.ITaskExecutionHost taskExecutionHost,
Microsoft.Build.BackEnd.Logging.TaskLoggingContext taskLoggingContext,
Microsoft.Build.BackEnd.TaskHost taskHost,
Microsoft.Build.BackEnd.ItemBucket bucket,
Microsoft.Build.BackEnd.TaskExecutionMode howToExecuteTask) [0x001f6]
in <58f0218f988743a48dd7c84cbe933f4e>:0 (MSB4018) (passcracker)
I cannot compile any application. Please help.
I had the same problem using .Net Standard 2.1, and I solved it for myself by cleaning the solution and then rebuilding it.
Just moved my projects to a new machine (copying, not pulling from GIT) and started getting this. Deleting the bin and obj folders in each project solved this issue.
Your combination of Mono MSBuild and .NET Core SDK is incompatible because they use different versions of the internal NuGet library. To resolve this problem, you can:
Downgrade .NET Core SDK to 2.1.5xx or 2.2.1xx (for example, 2.1.505 or 2.2.108)
Upgrade Mono to 6.0
You can find a detailed explanation of this problem and possible solutions here: https://rider-support.jetbrains.com/hc/en-us/articles/360004180039
This appears to be a known issue.
The only fix at this stage seems to be to downgrade to .NET Core v2.2.105.
To downgrade:
Uninstall the latest .NET Core version (v2.2.2+).
Download and install v2.2.105.
Run the following CMD in the *.sln folder. This will delete all your OBJ and BIN folders automatically. And your issue will be solved.
FOR /d /r . %%d in (bin,obj) DO ( IF EXIST "%%d" ( ECHO %%d | FIND /I "\node_modules\" > Nul && ( ECHO.Skipping: %%d ) || ( ECHO.Deleting: %%d rd /s/q "%%d" )))
I had the same problem in migration from .Net Framework 4.5 to .NET 6.0 (with the 70 project).
All of the above answers are correct, but they were not enough for my problem.
I use this answer:
Deleting the bin and obj and .vs folders then Clean Solution and
Rebuild Solution
it's working in Build Mode, not Rebuild. And the problem remained.
I update the Version of SDK , but not enough and I have the problem.
I realized this:
duplicate property (or variables) with the same name (or similar Name) in derived classes.
It was a good solution and a few problems were solved.
finally (after the 3 days), The biggest problem I noticed was that I had Loop References.
I fixed The Loop References in projects and the error is solved.
Change the name of the file. For instance, Add prefix _ or #; so, it cannot be used.
Restart Visual Studio, then try to build. If still problem is there, needs to restart the machine.
I had this error happen and the slove for me was correcting the Package version number in .csproj file .
<Version>2.0.7.</Version> <!--casued the error-->
<Version>2.0.7</Version> <!--this fixed the error-->
Removing the trailing '.' fixed this for me.
I had .net standard project built on .net standard 2.0. Yesterday I updated my Visual Studio 2019 to 16.3.0 to leverage .Net Core 3.0. But all of sudden build of project targeting on standard 2.0 started throwing "GenerateDepsFile" task failed unexpectedly error.
I was able to resolve this issue by changing the target framework to 2.1.
If you have <DelaySign>false</DelaySign> in your .csproj file remove it to solve this Problem.
in vs code i got this error, after trying some solution from forms, i found solution in deleting bin and obj foldersfrom project and build again.
this solved my problem.
vs code version: 1.53.1
dotnet version : 5
I had it after updating vs 2019 community,
Delete bin & obj folders,
then clean & build the solution.
I had this error and after reading comments, I was able to resolve by combining comments - First deleted bin folder, obj folder, executed clean command, deleted enter image description here and then rebuilded.

"AngularCli" does not exist in the "Microsoft.AspNetCore.SpaServices" namespace

I want to use Microsoft.AspNetCore.SpaServices.AngularCli but get error like this ("AngularCli" does not exist in the "Microsoft.AspNetCore.SpaServices" namespace). I added packege with command dotnet add package Microsoft.AspNetCore.SpaServices --version 2.0.1,but I still have problem with SpaServices
For Microsoft.AspNetCore.SpaServices.AngularCli, it exists under Microsoft.AspNetCore.SpaServices.Extensions package instead of Microsoft.AspNetCore.SpaServices.
Try to install Microsoft.AspNetCore.SpaServices.Extensions.
I had Microsoft.AspNetCore.SpaServices.Extensions installed, but had to update it.
Was using ASP.NETCore 3.1

In RouteRegistrar.php line 75: Attribute [Groupe] does not exist

when i usephp artisan serveto run my project it show me on error like this:
-->In RouteRegistrar.php line 75:
-->Attribute [Groupe] does not exist.
I had the same issue and bumped into your question via the Google-sphere.
Running composer install did the trick for me. I believe (at least in my case) that this error is the result of mismatched Laravel versioning vis-a-vis the routing code (I had the later version of Laravel specified in my composer.json but was working on an environment where I hadn't yet updated my composer packages).

Curses library not found

I'm trying to build 5.6.4-labs-innodb-memcached, but having this issue:
# cmake ./
-- MySQL 5.6.4-labs-innodb-memcached
-- Could NOT find Curses (missing: CURSES_LIBRARY CURSES_INCLUDE_PATH)
CMake Error at cmake/readline.cmake:83 (MESSAGE):
Curses library not found. Please install appropriate package,
remove CMakeCache.txt and rerun cmake.On Debian/Ubuntu, package name is libncurses5- dev, on Redhat and derivates it is ncurses-devel.
Call Stack (most recent call first):
cmake/readline.cmake:127 (FIND_CURSES)
cmake/readline.cmake:217 (MYSQL_USE_BUNDLED_LIBEDIT)
CMakeLists.txt:263 (MYSQL_CHECK_READLINE)
-- Configuring incomplete, errors occurred!
libncurses5-dev is installed and CURSES_USE_NCURSES=true is set, but it doesn't help.
Any ideas?
I have already compiled this package, but it was on the other machine...
EDITED:
/var/cache/apt/archives/libncurses5-dev_5.7+20101128-1_i386.deb
/var/lib/dpkg/info/libncurses5.postinst
/var/lib/dpkg/info/libncursesw5.list
/var/lib/dpkg/info/ncurses-base.preinst
/var/lib/dpkg/info/libncursesw5.postrm
/var/lib/dpkg/info/libncursesw5.shlibs
/var/lib/dpkg/info/libncursesw5.md5sums
/var/lib/dpkg/info/libncurses5.symbols
/var/lib/dpkg/info/ncurses-bin.preinst
/var/lib/dpkg/info/ncurses-bin.list
/var/lib/dpkg/info/libncurses5-dev.list
/var/lib/dpkg/info/libncursesw5.symbols
/var/lib/dpkg/info/libncursesw5.postinst
/var/lib/dpkg/info/libncurses5-dev.md5sums
/var/lib/dpkg/info/ncurses-base.conffiles
/var/lib/dpkg/info/libncurses5.shlibs
/var/lib/dpkg/info/ncurses-base.list
/var/lib/dpkg/info/ncurses-bin.md5sums
/var/lib/dpkg/info/libncurses5.md5sums
/var/lib/dpkg/info/libncurses5.list
/var/lib/dpkg/info/libncurses5.postrm
/var/lib/dpkg/info/ncurses-base.md5sums
/tmp/curses
/usr/include/cursesf.h
/usr/include/curses.h
/usr/include/cursesw.h
/usr/include/cursesp.h
/usr/include/ncurses_dll.h
/usr/include/ncurses.h
/usr/include/cursesm.h
/usr/include/cursesapp.h
/usr/share/lintian/overrides/ncurses-bin
/usr/share/lintian/overrides/ncurses-base
/usr/share/man/man1/ncursesw5-config.1.gz
/usr/share/man/man1/ncurses5-config.1.gz
/usr/share/doc/libncurses5
/usr/share/doc/libncurses5/TODO.Debian
/usr/share/doc/libncurses5/copyright
/usr/share/doc/libncurses5/FAQ
/usr/share/doc/libncurses5/changelog.Debian.gz
/usr/share/doc/ncurses-bin
/usr/share/doc/ncurses-bin/copyright
/usr/share/doc/ncurses-bin/changelog.Debian.gz
/usr/share/doc/libncurses5-dev
/usr/share/doc/libncurses5-dev/copyright
/usr/share/doc/libncurses5-dev/changelog.Debian.gz
/usr/share/doc/libncursesw5
/usr/share/doc/libncursesw5/copyright
/usr/share/doc/libncursesw5/changelog.Debian.gz
/usr/share/doc/ncurses-base
/usr/share/doc/ncurses-base/copyright
/usr/share/doc/ncurses-base/changelog.Debian.gz
/usr/bin/ncurses5-config
/usr/bin/aptitude-curses
/usr/bin/ncursesw5-config
/usr/lib/libncurses++.a
/usr/lib/libncurses.so
/usr/lib/libncurses.a
/usr/lib/libcurses.so
/usr/lib/libcurses.a
/usr/lib/python2.7/curses
/usr/lib/python2.7/curses/textpad.pyc
/usr/lib/python2.7/curses/has_key.pyc
/usr/lib/python2.7/curses/wrapper.py
/usr/lib/python2.7/curses/ascii.py
/usr/lib/python2.7/curses/panel.pyc
/usr/lib/python2.7/curses/has_key.py
/usr/lib/python2.7/curses/__init__.py
/usr/lib/python2.7/curses/textpad.py
/usr/lib/python2.7/curses/panel.py
/usr/lib/python2.7/curses/__init__.pyc
/usr/lib/python2.7/curses/wrapper.pyc
/usr/lib/python2.7/curses/ascii.pyc
/usr/lib/python2.7/lib-dynload/_curses.so
/usr/lib/python2.7/lib-dynload/_curses_panel.so
/lib/libncursesw.so.5.7
/lib/libncurses.so.5
/lib/libncursesw.so.5
/lib/libncurses.so.5.7
The error may be from cache file.
Delete CMakeCache.txt, then try again.
I do not know why is it failing, but you can use error message "missing ..." and set what is missing manually. I.e
cmake -DCURSES_LIBRARY=/usr/lib/libncurses.so -DCURSES_INCLUDE_PATH=/usr/include .
should fix it.
Perhaps you need additional ncurses files.
sudo yum install ncurses-devel
Then delete CMakeCache.txt
Try again to run CMake. This worked for me.
sudo aptitude install libncurses-dev in Debian.
For some reason, CMake can't find includes and libraries. Help it by running cmake -D CMAKE_PREFIX_PATH=/path/to/curses/prefix .
I had the same problem, Deleting the cache file worked for me.
This one works for me
locate libncurses.so
cmake -DCURSES_LIBRARY=/PATH OF THE LOCATE RESULT CURSES_INCLUDE_PATH=/usr/include