问题:Get无法解析有效composer.json上的版本约束。
我有 /srv/www/site/api/composer.json 和 /srv/www/site/frontend/composer.json 。目录/ srv / www / site / api /和/ srv / www / site / frontend /
中没有 composer.lock 或 vendor /Api composer.json和frontend composer.json包含相同的文字:
{
"minimum-stability": "stable",
"require":
{
"doctrine/dbal": "*"
},
"autoload":
{
"psr-4":
{
"app\\": "./"
}
}
}
首先。我跑了。
cd /srv/www/site/api
composer install
得到结果。好的。
Loading composer repositories with package information
Installing dependencies (including require-dev) from lock file
- Installing doctrine/lexer (v1.0.1)
Loading from cache
- Installing doctrine/annotations (v1.2.7)
Loading from cache
- Installing doctrine/cache (v1.4.2)
Loading from cache
- Installing doctrine/collections (v1.3.0)
Loading from cache
- Installing doctrine/inflector (v1.0.1)
Loading from cache
- Installing doctrine/common (v2.5.1)
Loading from cache
- Installing doctrine/dbal (v2.5.2)
Loading from cache
doctrine/dbal suggests installing symfony/console (For helpful console commands such as SQL execution and import of files.)
Generating autoload files
noopic@WhiteBear:/srv/www/dev.laronet.ee/api$ composer update
Loading composer repositories with package information
Updating dependencies (including require-dev)
Nothing to install or update
Generating autoload files
二。我跑了。
cd /srv/www/site/frontend
composer install
得到结果。错误。
[UnexpectedValueException]
Could not parse version constraint >: Invalid version string ""
install [--prefer-source] [--prefer-dist] [--dry-run] [--dev] [--no-dev] [--no-plugins] [--no-custom-installers] [--no-autoloader] [--no-scripts] [--no-progress] [-v|vv|vvv|--verbose] [-o|--optimize-autoloader] [-a|--classmap-authoritative] [--ignore-platform-reqs] [packages1] ... [packagesN]
如何解决?这是错误还是失败?
作曲家版本f85d965732d9505b69242a070dc0b381c9f6bbab
答案 0 :(得分:0)
只需删除用户目录中的.composer文件夹即可。对我来说 /home/noopic/.composer 。在两个目录中成功安装。
但如果我在前端跑步
composer update
得到同样的错误。