我正试图在Magento2.4上安装弹性套件2.10.1,但我需要将我的作曲家降级到版本1,但我一直被困住了。
当我试图用composer self-update --1将作曲家降为第1版时
[Composer\Downloader\FilesystemException]
Filesystem exception:
Composer update failed: "/usr/local/bin/composer" could not be written.
rename(/home/usr/.cache/composer/composer-temp7912166.phar,/usr/local/bin/composer): Permission denied在sudo中添加sudo: composer: command not found结果--我还全局安装了composer,并将.phar文件移动到了/usr/local/bin/composer
我还运行了composer update --no-plugins,它返回如下:
Problem 1
- Root composer.json requires dealerdirect/phpcodesniffer-composer-installer ^0.5.0 -> satisfiable by dealerdirect/phpcodesniffer-composer-installer[v0.5.0].
- dealerdirect/phpcodesniffer-composer-installer v0.5.0 requires composer-plugin-api ^1.0 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
Problem 2
- laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4] require composer-plugin-api ^1.1 -> found composer-plugin-api[2.1.0] but it does not match the constraint.
- magento/product-community-edition 2.4.0 requires laminas/laminas-dependency-plugin ^1.0 -> satisfiable by laminas/laminas-dependency-plugin[1.0.0, ..., 1.0.4].
- Root composer.json requires magento/product-community-edition 2.4.0 -> satisfiable by magento/product-community-edition[2.4.0].在过去的两个小时里,我一直在谷歌上搜索答案,但没有任何进展,我对如何解决这个问题没有什么想法。
发布于 2021-12-20 07:57:29
如果确实希望使用Composer v1 (这是不推荐的,而且不会永远存在!),您需要在前面运行带有sudo的降级,以避免权限问题。
发布于 2022-08-27 06:30:55
以下几点对我来说是可行的:
首先,在这里检查composer和php版本的需求:https://devdocs.magento.com/guides/v2.4/install-gde/system-requirements.html
删除供应商文件夹
假设您使用的是composer 2,对于Magento 2.4.0-2.4.3-P2,运行:
sudo composer self-update --1运行以下命令:
sudo yum install php php-{pear,cgi,common,ctype,curl,fileinfo,mbstring,gd,hash,iconv,sockets,sodium,tokenizer,xmlwriter,xsl,mysqlnd,gettext,bcmath,json,xml,fpm,intl,zip,imap,dom,simplexml,soap,libxml,openssl}
sudo composer installhttps://stackoverflow.com/questions/70416206
复制相似问题