why do i get PHP fatal error when i want to install an extension

我的未来我决定 提交于 2019-12-21 12:17:35

问题


$php composer.phar require "kartik-v/yii2-password": "@dev"

Error msg:

Call to undefined method Fxp\Composer\AssetPlugin\Package\Version\VersionParser::parseLinks() in /home/john/.composer/vendor/fxp/composer-asset-plugin/Repository/VcsPackageFilter.php on line 272

When i wanna add an extension in my project i got this error, help me to solve it.


回答1:


You should delete composer asset plugin :

  • Linux : rm -rf ~/.composer/vendor/fxp
  • Windows : rm -r %APPDATA%\Composer\vendor\fxp

And re-install it :

composer global require "fxp/composer-asset-plugin:~1.1.1"

Read more : https://github.com/francoispluchino/composer-asset-plugin/pull/133




回答2:


Try this, I had the same error with an old version (existing folder) of the plugin:

$ composer global update

or if the global update doesn't work, you can remove manually the global installation folder of this plugin in C:\Users\$USERNAME\AppData\Roaming\Composer\vendor\fxp\composer-asset-plugin and reinstall the plugin by running the command:

$ composer global update




回答3:


Following Federico advice what I've done is the following

rm -rf /root/.composer/*
composer global require "fxp/composer-asset-plugin:~1.0"

And now everything works fine.



来源:https://stackoverflow.com/questions/32901750/why-do-i-get-php-fatal-error-when-i-want-to-install-an-extension

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!