run composer require "yiisoft/yii2:~2.0.10"
in terminal
yii2 to update
yii2 doesn't update
| Q | A
| ---------------- | ---
| Yii version | 2.0.5
| PHP version | 5.5.35
| Operating system | OSX 10.12.2
Problem 1
- Installation request for yiisoft/yii2 ~2.0.10 -> satisfiable by yiisoft/yii2[2.0.10].
- Conclusion: don't install bower-asset/jquery.inputmask 3.1.63
- yiisoft/yii2 2.0.10 requires bower-asset/jquery.inputmask ~3.2.2 -> satisfiable by bower-asset/jquery.inputmask[3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.7].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.6].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.5].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.4].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.3].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.2].
- Installation request for bower-asset/jquery.inputmask (locked at 3.1.63) -> satisfiable by bower-asset/jquery.inputmask[3.1.63].
Cannot reproduce. What I've tried in clean directory:
composer self-update // 1.3.1 is used
composer global update // to make sure latest fxp is used
composer clear-cache // to make sure success is not because of cache
composer require "yiisoft/yii2:~2.0.10"
FXP plugin is installed globally.
Sorry, getting the same error. Is there any way I could troubleshoot this?
Here's the full output
$ composer self-update
You are already using composer version 1.3.1 (stable channel).
$ composer global update
Changed current directory to ~/.composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
$ composer clear-cache
Clearing cache (cache-dir): ~/.composer/cache
Clearing cache (cache-files-dir): ~/.composer/cache/files
Clearing cache (cache-repo-dir): ~/.composer/cache/repo
Cache directory does not exist (cache-vcs-dir):
All caches cleared.
$ composer require "yiisoft/yii2:~2.0.10"
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for yiisoft/yii2 ~2.0.10 -> satisfiable by yiisoft/yii2[2.0.10].
- Conclusion: don't install bower-asset/jquery.inputmask 3.1.63
- yiisoft/yii2 2.0.10 requires bower-asset/jquery.inputmask ~3.2.2 -> satisfiable by bower-asset/jquery.inputmask[3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.7].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.6].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.5].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.4].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.3].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.2].
- Installation request for bower-asset/jquery.inputmask (locked at 3.1.63) -> satisfiable by bower-asset/jquery.inputmask[3.1.63].
Installation failed, reverting ./composer.json to its original content.
Do you have composer asset plugin installed globally?
Honestly, I'm not very strong at console stuff, can you help me find that out please? Thanks.
composer global info
and then search for fxp/composer-asset-plugin
.
Here's the output:
$ composer global info
Changed current directory to ~/.composer
fxp/composer-asset-plugin v1.2.2 NPM/Bower Dependency Manager for Composer
Is this good or bad?
When updating an existing installation, you should add the --update-with-dependencies
parameter, e.g.:
composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
Composer will not touch any other packages than the one you specified and might fail if yii's dependencies have changed a bit.
See also https://github.com/yiisoft/yii2/blob/master/framework/UPGRADE.md#upgrading-instructions-for-yii-framework-20
Alright, this looks better, no error this time, but it looks it only upgraded me to 2.0.6 instead of 2.0.10. Any reason for that?
Here is the most recent output:
$ composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
./composer.json has been created
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 8 installs, 0 updates, 0 removals
- Installing yiisoft/yii2-composer (2.0.5) Downloading: 100%
- Installing bower-asset/jquery (2.2.4) Downloading: 100%
- Installing bower-asset/yii2-pjax (v2.0.6) Downloading: 100%
- Installing bower-asset/punycode (v1.3.2) Downloading: 100%
- Installing bower-asset/jquery.inputmask (3.2.7) Downloading: 100%
- Installing cebe/markdown (1.1.1) Downloading: 100%
- Installing ezyang/htmlpurifier (v4.9.0) Downloading: 100%
- Installing yiisoft/yii2 (2.0.10) Downloading: 100%
Writing lock file
Generating autoload files
Scratch that, I think it was only successful because accidentally I ran it in my home folder. If I run it in the project directory, I get the exact same error as I got at the very beginning of this issue. I actually wanted to ask if it counted in which folder I ran composer, and apparently it does count, going out from the
Here is what I did this time:
$ composer self-update
You are already using composer version 1.3.1 (stable channel).
$ composer global update
Changed current directory to ~/.composer
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
$ composer clear-cache
Clearing cache (cache-dir): ~/.composer/cache
Clearing cache (cache-files-dir): ~/.composer/cache/files
Clearing cache (cache-repo-dir): ~/.composer/cache/repo
Cache directory does not exist (cache-vcs-dir):
All caches cleared.
$ composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resolved to an installable set of packages.
Problem 1
- Installation request for yiisoft/yii2 ~2.0.10 -> satisfiable by yiisoft/yii2[2.0.10].
- Conclusion: don't install bower-asset/jquery.inputmask 3.1.63
- yiisoft/yii2 2.0.10 requires bower-asset/jquery.inputmask ~3.2.2 -> satisfiable by bower-asset/jquery.inputmask[3.2.7, 3.2.6, 3.2.5, 3.2.4, 3.2.3, 3.2.2].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.7].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.6].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.5].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.4].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.3].
- Can only install one of: bower-asset/jquery.inputmask[3.1.63, 3.2.2].
- Installation request for bower-asset/jquery.inputmask (locked at 3.1.63) -> satisfiable by bower-asset/jquery.inputmask[3.1.63].
Installation failed, reverting ./composer.json to its original content.
[ Note: I'm replacing /User/username/
with ~/
in the output, assuming that is irrelevant here ]
Ah, that's what it is. I've tried with empty directory and that's why it worked.
Usually I'm adding version to composer.json and doing composer update
but it should not matter. There's something interesting going on with existing project dependencies. Most probably one of Yii's dependency version is fixed in your composer.json and that's why it can't install.
Show result of
composer depends bower-asset/jquery.inputmask
@rob006
$ composer depends bower-asset/jquery.inputmask
[InvalidArgumentException]
Could not find package "bower-asset/jquery.inputmask" in your project
depends [-r|--recursive] [-t|--tree] [--] <package> [<constraint>]
To be honest, I remember deleting it from the vendor
folder once, because someone somewhere actually suggested to get rid of the whole vendor
folder, but I thought I'd just remove that one package, and it should solve it, yet I kept getting the same error. But shouldn't it reinstall it automatically if it's missing...?
Alright, this looks better, no error this time, but it looks it only upgraded me to 2.0.6 instead of 2.0.10. Any reason for that?
composer shows 2.0.10:
- Installing yiisoft/yii2 (2.0.10) Downloading: 100%
I think --update-with-dependencies
should include the bower package but composer says it is locked, not sure why that is.
I tried the following upgrade scenario in an empty directory:
# first install 2.0.5
composer require "yiisoft/yii2:2.0.5"
# then upgrade
composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
It upgraded successfully:
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 3 updates, 0 removals
- Updating bower-asset/jquery.inputmask (3.1.63 => 3.2.7) Loading from cache
- Updating ezyang/htmlpurifier (v4.6.0 => v4.9.0) Loading from cache
- Updating yiisoft/yii2 (2.0.5 => 2.0.10) Loading from cache
Writing lock file
Generating autoload files
Please show your composer.json there must be something different in your environment.
I ran into same problem when ich was downgrading from dev-master to 2.0.10 and --update-with-dependencies
did solve it
This is my composer.json:
{
"name": "yiisoft/yii2-app-basic",
"description": "Yii 2 Basic Project Template",
"keywords": ["yii2", "framework", "basic", "project template"],
"homepage": "http://www.yiiframework.com/",
"type": "project",
"license": "BSD-3-Clause",
"support": {
"issues": "https://github.com/yiisoft/yii2/issues?state=open",
"forum": "http://www.yiiframework.com/forum/",
"wiki": "http://www.yiiframework.com/wiki/",
"irc": "irc://irc.freenode.net/yii",
"source": "https://github.com/yiisoft/yii2"
},
"minimum-stability": "stable",
"require": {
"php": ">=5.4.0",
"yiisoft/yii2": "~2.0.6",
"yiisoft/yii2-bootstrap": "*",
"yiisoft/yii2-swiftmailer": "*"
},
"require-dev": {
"yiisoft/yii2-codeception": "*",
"yiisoft/yii2-debug": "*",
"yiisoft/yii2-gii": "*",
"yiisoft/yii2-faker": "*"
},
"config": {
"process-timeout": 1800
},
"scripts": {
"post-create-project-cmd": [
"yii\\composer\\Installer::postCreateProject"
]
},
"extra": {
"yii\\composer\\Installer::postCreateProject": {
"setPermission": [
{
"runtime": "0777",
"web/assets": "0777",
"yii": "0755"
}
],
"generateCookieValidationKey": [
"config/web.php"
]
},
"asset-installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
So the issue is still there, I'm still on 2.0.6... why?
We can not reproduce your problem and nobody reports similar.
It seems, that the problem is on your side.
ok, so what do you suggest me to do? is there no way I could just download the package and unzip it inside the proper folder, and start using it, just like it was with 1.1?
Have you tried to remove vendor
directory and then call composer install
?
ok, I deleted the vendor folder, then ran composer install
(which changed nothing), however this time running composer require "yiisoft/yii2:~2.0.10" --update-with-dependencies
did the trick; I'm actully on 2.0.11.2 now. Thank you guys.
Most helpful comment
Have you tried to remove
vendor
directory and then callcomposer install
?