Composer已损坏:类Fxp \ Composer \ AssetPlugin \ Repository \ NpmRepository不存在

时间:2016-04-24 01:39:54

标签: php composer-php

我无法让作曲家工作。当我尝试部署到Heroku时它也失败了。

$ composer update
  [ReflectionException]
  Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

$ rm -r ~/.composer

$ composer global require fxp/composer-asset-plugin --no-plugins
Changed current directory to /home/Chloe/.composer
Using version ^1.1 for fxp/composer-asset-plugin
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
  - Installing fxp/composer-asset-plugin (v1.1.4)
    Downloading: 100%

Writing lock file
Generating autoload files

$ composer update
  [ReflectionException]
  Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist

我尝试了Composer throws [ReflectionException] Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not existUpdating composer throws exception Class Fxp\Composer\AssetPlugin\Repository\NpmRepository does not exist中的步骤,但仍然失败了。

我也跑了composer self-update但仍然无效。

PHP 5.6.19,Composer 1.1-dev版,Composer版本1.0.2 2016-04-21 12:30:18

2 个答案:

答案 0 :(得分:2)

问题是您需要fxp/composer-asset-plugin的版本,现在已经被composer> = 1.0打破了。

"fxp/composer-asset-plugin": "^1.0",

由于您已在全球范围内安装,因此可以从composer.json中删除它。

答案 1 :(得分:0)

我有类似的错误。尝试

composer global require fxp/composer-asset-plugin --no-plugins

这对我有用