如果你在某个目录使用composer.phar,而且在别的目录页使用了composer,并没有全局安装composer的时候,不同目录之间的可能会互相干扰从而报错
[email protected]:/var/www/html/laravel# composer global require "laravel/installer=~1.1" Changed current directory to /root/.composer PHP Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272 Fatal error: Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /root/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272 [email protected]:/var/www/html/laravel# ll
导致这个错误的原因是没有全局安装composer.phar并添加到linux的系统环境变量,从而导致composer.phar之间的混乱,要仔细研究composer提高使用效率
For those who still same the problem (I have ubuntu):
just remove directory /home/user/.composer/vendor/fxp
just remove directory /home/user/.composer/vendor/fxp
这就是最终的解决办法。其实是类似于初始化的作用,不是说干扰
https://github.com/yiisoft/yii2/issues/9794 解决办法
时间: 2024-10-20 18:22:25