I installed the latest version (1.0.0. stable) of composer and in my Yii2 project I typed this:
php composer.phar update
It gives me this error
If none of the other solutions have worked for you, please try AssetPackagist as an alternative.
Add the packages bower-asset/bootstrap and npm-asset/jquery to composer.json like the following:
"require": {
"bower-asset/bootstrap": "^3.3",
"npm-asset/jquery": "^2.2"
}
Add a repositories block (if you still don't have one, if you do, just append to it) with the following content:
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
Run composer install
(or composer update
)
Considering that asset-packagist installs assets in a different directory, add the following lines to your application config (usually called as web.php):
$config = [
'aliases' => [
'@bower' => '@vendor/bower-asset',
'@npm' => '@vendor/npm-asset',
],
];
These instructions may change over time. They have been copied from the repo website so they could last in time just in case something happens to the website. I am not the author of the repo but I really appreciate the effort made into it. Please check https://asset-packagist.org/site/about to know more about the project.
If you are struggling with composer, here you have some useful commands:
composer clear-cache
- Clear composer related caches
composer install -vvv
- Add the parameter "vvv" to show installation process related output (useful to debug)
composer global show
- Useful to check if you already have fxp/composer-asset-plugin installed. In my case, it already was, however it was not being detected as a dependency, and the solution I described earlier worked flawless to me - hope it does work for you too!