[英]Composer: Packages not found on server, but on local machine
I have two identical composer.json
on my local windows machine and my linux dev server: 我在本地Windows机器和Linux开发服务器上有两个相同的composer.json
:
"name": "yiisoft/yii2-app-advanced",
"description": "Yii 2 Advanced Project Template",
"keywords": ["yii2", "framework", "advanced", "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": "~2.0.0",
"yiisoft/yii2-swiftmailer": "~2.0.0",
"yiisoft/yii2-jui": "^2.0",
"kartik-v/yii2-widget-select2": "@dev",
"2amigos/yii2-file-upload-widget": "~1.0",
"cozumel/yii2-image-cropper": "*",
"yii2mod/yii2-ion-slider": "*"
},
"require-dev": {
"yiisoft/yii2-debug": "~2.0.0",
"yiisoft/yii2-gii": "~2.0.0",
"yiisoft/yii2-faker": "~2.0.0",
"codeception/base": "^2.2.3",
"codeception/verify": "~0.3.1"
},
"config": {
"process-timeout": 1800,
"fxp-asset":{
"installer-paths": {
"npm-asset-library": "vendor/npm",
"bower-asset-library": "vendor/bower"
}
}
}
On my local machine, I can update composer without any problems: 在我的本地计算机上,我可以毫无问题地更新composer:
Loading composer repositories with package information
Updating dependencies (including require-dev)
Package operations: 0 installs, 4 updates, 0 removals
- Updating yiisoft/yii2-debug (2.0.9 => 2.0.10): Downloading (100%)
- Updating bower-asset/blueimp-file-upload (v9.19.0 => v9.19.1): Downloading (100%)
- Updating phpspec/prophecy (v1.7.0 => v1.7.2): Downloading (100%)
- Updating kartik-v/yii2-widget-select2 dev-master (a129c66 => 2c3f475): Checking out 2c3f47527c
Writing lock file
Generating autoload files 生成自动加载文件
Yet on my server, I get the error that the packages could not be found: 但是在我的服务器上,我收到错误消息,找不到软件包:
$ composer update
You are running composer with xdebug enabled. This has a major impact on runtime performance. See https://getcomposer.org/xdebug
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
- yiisoft/yii2 2.0.x-dev requires bower-asset/punycode 1.3.* -> no matching package found.
- 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.
- yiisoft/yii2 2.0.8 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable -> no matching package found.
- 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.12 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- yiisoft/yii2 2.0.11.2 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- yiisoft/yii2 2.0.11.1 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- yiisoft/yii2 2.0.11 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- yiisoft/yii2 2.0.10 requires bower-asset/jquery 2.2.*@stable | 2.1.*@stable | 1.11.*@stable | 1.12.*@stable -> no matching package found.
- Installation request for yiisoft/yii2 ~2.0.6 -> satisfiable by yiisoft/yii2[2.0.10, 2.0.11, 2.0.11.1, 2.0.11.2, 2.0.12, 2.0.6, 2.0.7, 2.0.8, 2.0.9, 2.0.x-dev].
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://getcomposer.org/doc/04-schema.md#minimum-stability> for more details.
Read <https://getcomposer.org/doc/articles/troubleshooting.md> for further common problems.
After quite some hours of searching around, I still don't have any clue where to even begin with. 经过数小时的搜索,我仍然不知道从哪里开始。 Any ideas? 有任何想法吗?
Try adding this to the end of your composer.json: 尝试将其添加到composer.json的末尾:
"repositories": [
{
"type": "composer",
"url": "https://asset-packagist.org"
}
]
Since the server can't find any packages, there seem to be something wrong with the repository definition. 由于服务器找不到任何软件包,因此存储库定义似乎有问题。 Not sure, but in your local composer environment the repo above may have been defined outside of your composer.json (as a default perhaps). 不确定,但是在您的本地作曲家环境中,上面的存储库可能已在composer.json之外定义(可能是默认设置)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.