I'm trying to install Yii2 via composer:
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
~/.composer/composer.json
{
"require": {
"fxp/composer-asset-plugin": "~1.1.1"
}
}
result:
Problem 1
- yiisoft/yii2 2.0.x-dev requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- yiisoft/yii2 dev-master requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6, dev-master, 2.0.x-dev].
What do I do wrong?
rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:^1.1.3"
composer install
Then go to your work directory and run:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
You can try the newer version:
composer global require "fxp/composer-asset-plugin:^1.2.0"
then:
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
Non-install Bower-Asset way:
You can download Yii2 by Install from an Archive File. By this way you won't need to handle Bower issue.
Further, if you need to update composer without handling Bower, you can require yidas/yii2-composer-bower-skip before yiisoft/yii2 in composer.json file:
"require": {
"php": ">=5.4.0",
"yidas/yii2-composer-bower-skip": "~2.0.0",
"yiisoft/yii2": "~2.0.5",
"yiisoft/yii2-bootstrap": "~2.0.0"
}
Instead, if you want to create yii2 project without bower-asset issue:
yidas/yii2-app-basic:
composer create-project yidas/yii2-app-basic
yidas/yii2-app-advanced:
composer create-project yidas/yii2-app-advanced
From Yii 2.0.13, it used Asset-Packagist solution instead of fxp/composer-asset-plugin
This problem could be also resolved via
composer require yidas/yii2-bower-asset
More details about this package: https://packagist.org/packages/yidas/yii2-bower-asset
https://getcomposer.org/Composer-Setup.exe
download and install. After installing run this command line in your project folder composer update
Solved. I needed to install the Composer Asset Plugin first:
php composer.phar global require "fxp/composer-asset-plugin:1.0.0"
First change the .composer permissions
sudo chown -R $USER .composer/
Then
composer global require "fxp/composer-asset-plugin:^1.2.0"
Related
I'm trying to install Yii2 via Composer (OS X El Capitan 10.11.3).
I did this
php composer.phar global require "fxp/composer-asset-plugin:~1.1.1"
and then
php composer.phar create-project yiisoft/yii2-app-basic basic 2.0.9
and I've got errors like
yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.#stable | 2.1.#stable | 1.11.#stable | 1.12.#stable -> no matching package found.
I don't know why it happens. I tried to reinstall (composer and asset-plugin), diff version as well and again the same problem with yiisoft/yii2 2.0.9 requires bower-asset/jquery 2.2.#stable
Try to install composer global require "fxp/composer-asset-plugin: *" first. Also, make sure you have these added in your composer.json file:
"extra": {
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
Another solution is to attempt to self-update:
composer self-update --rollback
If these solutions did not work, you can try to use this sequence of commands:
rm -rf ~/.composer/vendor
rm ~/.composer/composer.lock
cd ~/.composer
composer clear-cache
composer self-update
composer global require "fxp/composer-asset-plugin:~1.1.3"
composer install
Source 1 | Source 2 | Source 3 | Source 4
composer global require "fxp/composer-asset-plugin:~1.1.1"
composer create-project --prefer-dist yiisoft/yii2-app-advanced yii-application
The first command installs the composer asset plugin which allows managing bower and npm package dependencies through Composer. You only need to run this command once for all.
The second command installs the latest stable version of Yii in a directory named basic. You can choose a different directory name if you want.
composer create-project --prefer-dist yiisoft/yii2-app-basic basic
The following is the ouput of above command
Installing yiisoft/yii2-app-basic (2.0.6)
- Installing yiisoft/yii2-app-basic (2.0.6)
Loading from cache
Created project in basic
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- yiisoft/yii2 2.0.6 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- yiisoft/yii2 2.0.5 requires bower-asset/jquery 2.1.*#stable | 1.11.*#stable -> no matching package found.
- Installation request for yiisoft/yii2 >=2.0.5 -> satisfiable by yiisoft/yii2[2.0.5, 2.0.6].
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
Please, refer the installation guide. It seems that you are missing asset plugin:
composer global require "fxp/composer-asset-plugin:~1.2.0"
You should run composer clear-cache first before running
composer global require "fxp/composer-asset-plugin:~1.1.1"
This worked for me.
I am installing external dependencies using composer update command. The following is the section of the composer.json file in c:\xampp\htdocs\myproject\vendor\laravel\framework\ directory.
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*"
"illuminate/html": "5.0.*#dev"
},
I am getting the following results after running the composer update command:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Writing lock file
Generating autoload files
I have also tried to create another require array in the composer.json and added the packages I want to install with no success.
The composer update command could not install any unstalled dependency using the composer update command. Even composer self-update did not solve the problem.
Kindly assist me, I have been stuck here for some days now trying all I would do but without success.
I am changing the composer.json under the following directory: c:\xampp\htdocs\myproject\vendor\laravel\framework\ Is this ok?
Don't change any files inside the vendor directory, they are managed by Composer. To install further packages use the composer.json in your project's directory.
And use composer install to install new packages as composer update will update already installed packages to newer versions (if available) too.
composer self-update just updates Composer itself.
You missed column after "matriphe/imageupload": "5.1.*", try to change it:
"require": {
"laravelcollective/html": "~5.0",
"matriphe/imageupload": "5.1.*",
"illuminate/html": "5.0.*#dev"
}
Trying to install Bolt v2.2.4 with the following commands:
git clone git://github.com/bolt/bolt.git bolt
cd bolt
git checkout v2.2.4
composer install
Then I get the following error:
$ composer install
Loading composer repositories with package information
Installing dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for m6web/symfony2-coding-standard dev-master#dev -> satisfiable by m6web/symfony2-coding-standard[dev-master].
- m6web/symfony2-coding-standard dev-master requires squizlabs/php_codesniffer ~1.0 -> no matching package found.
Potential causes:
- A typo in the package name
- The package is not available in a stable-enough version according to your minimum-stability setting
see <https://groups.google.com/d/topic/composer-dev/_g3ASeIFlrc/discussion> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
I just ran into the same issue under bolt 2.1.9
I 'fixed' it for me for the moment by changing 1.5.* to ~2 for squizlabs/php_codesniffer in composer.json
Are you on IPv6 per chance? If so, do a composer self-update.
Found documentation about this widget here and library here.
Tried to install with Composer and failed:
Tried to copy "yiisoft/yii2-jui": "~2.0.0" to composer.json and then update Composer and failed again:
Class 'yii\jui\DatePicker' not found
Is there any way to install this extension without using Composer?
Did you install composer global require "fxp/composer-asset-plugin:1.0.0" ? It is a NPM/Bower Dependency Manager for Composer that required by yii2. Before installing yii2-jui try this command, and then composer update