In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-03-29 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/02 Report--
This article mainly introduces what are the common mistakes in Composer. It is very detailed and has a certain reference value. Friends who are interested must finish it!
Solutions to common errors in Composer
Error encountered in executing composer install: Your requirements could not be resolved to an installable set of packages. This is because the version required by composer.json does not match.
The complete error is as follows:
Vagrant@homestead:/usr/share/nginx/html/laravel-blog$ sudocomposerinstallLoadingcomposerrepositorieswithpackage informationInstallingdependencies (includingrequire-dev) fromlockfileYourrequirementscouldnot beresolvedto aninstallablesetofpackages. Problem 1-Installationrequestfor doctrine/instantiator 1.0.3-> satisfiablebydoctrine/instantiator [1.0.3]. -doctrine/instantiator 1.0.3 requiresphp ~ 5.3-> yourPHPversion (7.0.3) doesnot satisfythatrequirement. Problem 2-doctrine/instantiator 1.0.3 requiresphp ~ 5.3-> yourPHPversion (7.0.3) doesnot satisfythatrequirement. -phpunit/phpunit-mock-objects 2.3.0 requiresdoctrine/instantiator ~ 1.0, > = 1.0.1-> satisfiablebydoctrine/instantiator [1.0.3]. -Installationrequestfor phpunit/phpunit-mock-objects 2.3.0-> satisfiablebyphpunit/phpunit-mock-objects [2.3.0].
It is suggested that my version of PHP 7 is too high to meet the required version of composer.json, but it should also run under PHP 7. Composer can be set to ignore version matching. The command is:
Composerinstall-ignore-platform-reqs
Or
Composerupdate-ignore-platform-reqs
Execute the composer command again to install the package normally.
If prompted to warn:
Cannotcreatecachedirectory / home/vagrant/.composer/cache/repo/https---packagist.org/, or directoryis not writable. Proceedingwithoutcache Cannotcreatecachedirectory / home/vagrant/.composer/cache/files/, or directoryis not writable. Proceedingwithoutcache
This is to execute composer in the virtual machine, indicating that there is no writeable permission for this directory, and composer cannot cache the downloaded package, so you have to download it again every time and change the directory to writable and readable.
Sudo chmod-R 777 / home/vagrant/.composer/cache/files/
In addition, set composer as the domestic image in the virtual machine, otherwise the download speed will be extremely slow, and execute:
Composerconfig-g repo.packagistcomposer https://packagist.phpcomposer.com above is all the content of this article "what are the Common mistakes in Composer?" Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.