bennysr
(Bennysr1)
December 4, 2015, 7:30am
1
Hi, i am newbie in Yii.
I am trying to install Yii 2.0 via composer on my iMac 27 inch 2012 with OS X El Capitan (10.11.1)
I have followed the steps as shown from getcomposer.org about installation-linux-unix-osx
and also refer to guide-start-installation from yiiframework.com
After downloading installer then run it from directory /Applications/XAMPP/htdocs
$ sudo chmod 777 installer
$ ./installer
After composer.phar has been created, then i run a command to install the Composer Asset Plugin:
$ php composer.phar global require “fxp/composer-asset-plugin:~1.1.1”
The error message was :
[UnexpectedValueException]
Could not parse version constraint ~1.1.1”: Invalid version string "~1.1.1”"
Is there something missing i’ve done causing this error?
Hope any Guru give me some clue to solve this …
Note:
I have install Netbeans 8.1 with JDK 8
Apache already run using XAMPP
Thanks a lot,
Benny.
jacmoe
(Jacob Moena)
December 4, 2015, 7:37am
2
Try using just:
composer require fxp/composer-asset-plugin
bennysr
(Bennysr1)
December 4, 2015, 8:00am
3
YES … it works.
But, when i try to continue to create a project :
$ php composer.phar create-project --prefer-dist yiisoft/yii2-app-basic basic
Installing yiisoft/yii2-app-basic (2.0.6)
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.
====
jacmoe
(Jacob Moena)
December 4, 2015, 12:02pm
4
I have seen that error before - but I can’t honestly remember what the solution was …
I do know, however, that this has always worked for me:
composer global require "fxp/composer-asset-plugin:~1.1.0"
Notice the difference between yours and that: the last digit.
I find that Composer moves in mysterious ways too many times.
Before running that, however, you need to go to the global Composer installation directory and remove the fxp directory.
And probably run a composer global clear-cache just for good measure.
And then install the fxp/composer-asset-plugin using the command above ^
jacmoe
(Jacob Moena)
December 4, 2015, 12:06pm
5
And, to be honest, a regular composer clear-cache (that is: local) seems to solve many, many issues that might arise.
It has saved me from grey hairs many times.
podge
(Podgeufz)
April 5, 2016, 4:29pm
7
Hello Jacmoe,
I experienced the same error after running the command
php composer.phar create-project --prefer-dist yiisoft/yii2-app-basic basic
I’d type in the same error message but being my first post the systems is not letting my type in links…
I did the steps you suggested (removing fxp directory & previous project directory. composer global clear cache and installed the 1.1.0 version of the asset plugin.
Any suggestions?
Much appreciated
jacmoe
(Jacob Moena)
April 5, 2016, 5:36pm
8
You need at least version 1.1.1 1.1.3
Bizley
(Bizley)
April 5, 2016, 5:53pm
9
Just in case - with latest composer version I’ve got an error. Solution was to --rollback composer selfupdate, install composer-asset-plugin v1.1.3, then composer selfupdate and finally composer update.
podge
(Podgeufz)
April 5, 2016, 6:21pm
10
Thanks for your reply Jacmoe,
Unfortunately using 1.1.1 also leads to the same error
If this helps, I’m on a fresh installation of Mac OSX 10.11 system
Thanks again
jacmoe
(Jacob Moena)
April 5, 2016, 6:42pm
11
Oh, so it’s 1.1.3 now - that asset plugin sure it a pain in the rear.
podge
(Podgeufz)
April 8, 2016, 6:13pm
12
So, I tried version 1.1.3 now and I get these error:
Problem 1
- yiisoft/yii2 2.0.7 requires bower-asset/jquery 2.2.*@stable | 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, 2.0.7].
All help appreciated as always,.