安装 webman/database 出现 这种错误

小小袋鼠

问题描述

这里详细描述问题

webman/database[v2.1.0, ..., v2.1.4] require workerman/webman-framework ^2.1 || dev-master -> found workerman/webman-framework[dev-master, v2.1.0, v2.1.1] but it conflicts with your root composer.json require (^1.5.0).

  • Root composer.json requires webman/database ^2.1 -> satisfiable by webman/database[v2.1.0, ..., v2.1.4].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require webman/database:*" to figure out if any version is installable, or "composer require webman/database:^2.1" if you know which you need.

程序代码

composer require -W webman/database illuminate/pagination illuminate/events symfony/var-dumper

报错信息

webman/database[v2.1.0, ..., v2.1.4] require workerman/webman-framework ^2.1 || dev-master -> found workerman/webman-framework[dev-master, v2.1.0, v2.1.1] but it conflicts with your root composer.json require (^1.5.0).

  • Root composer.json requires webman/database ^2.1 -> satisfiable by webman/database[v2.1.0, ..., v2.1.4].

You can also try re-running composer require with an explicit version constraint, e.g. "composer require webman/database:*" to figure out if any version is installable, or "composer require webman/database:^2.1" if you know which you need.

截图报错信息里报错文件相关代码

截图

操作系统及workerman/webman等框架组件具体版本

{
"name": "workerman/webman",
"type": "project",
"keywords": [
"high performance",
"http service"
],
"homepage": "https://www.workerman.net",
"license": "MIT",
"description": "High performance HTTP Service Framework.",
"authors": [
{
"name": "walkor",
"email": "walkor@workerman.net",
"homepage": "https://www.workerman.net",
"role": "Developer"
}
],
"support": {
"email": "walkor@workerman.net",
"issues": "https://github.com/walkor/webman/issues",
"forum": "https://wenda.workerman.net/",
"wiki": "https://workerman.net/doc/webman",
"source": "https://github.com/walkor/webman"
},
"require": {
"php": ">=7.2",
"workerman/webman-framework": "^1.5.0",
"monolog/monolog": "^2.0",
"webman/admin": "1.0",
"topthink/think-template": "^2.0",
"webman/console": "^2.1",
"vlucas/phpdotenv": "^5.6"
},
"suggest": {
"ext-event": "For better performance. "
},
"autoload": {
"psr-4": {
"": "./",
"app\": "./app",
"App\": "./app",
"app\View\Components\": "./app/view/components"
},
"files": [
"./support/helpers.php"
]
},
"scripts": {
"post-package-install": [
"support\Plugin::install"
],
"post-package-update": [
"support\Plugin::install"
],
"pre-package-uninstall": [
"support\Plugin::uninstall"
]
},
"minimum-stability": "dev",
"prefer-stable": true
}

193 1 0
1个回答

  • 小小袋鼠 2天前

    我重新安装了 V2 版本 然后 安装了
    composer require -W webman/database illuminate/pagination illuminate/events symfony/var-dumper

    Using version ^2.1 for webman/database
    Using version ^8.83 for illuminate/pagination
    Using version ^8.83 for illuminate/events
    Using version ^5.4 for symfony/var-dumper
    ./composer.json has been updated
    Running composer update webman/database illuminate/pagination illuminate/events symfony/var-dumper --with-all-dependencies
    Loading composer repositories with package information
    Updating dependencies
    Your requirements could not be resolved to an installable set of packages.

    Problem 1

    • webman/database[v2.1.0, ..., v2.1.4] require workerman/webman-framework ^2.1 || dev-master -> found workerman/webman-framework[dev-master, v2.1.0, v2.1.1] but it conflicts with your root composer.json require (^1.5.0).
    • Root composer.json requires webman/database ^2.1 -> satisfiable by webman/database[v2.1.0, ..., v2.1.4].

    You can also try re-running composer require with an explicit version constraint, e.g. "composer require webman/database:*" to figure out if any version is installable, or "composer require webman/database:^2.1" if you know which you need.

    Installation failed, reverting ./composer.json and ./composer.lock to their original content.

    又出来 这个错误。

  • 小小袋鼠 2天前

    之前 一直 没有出现过 这种情况

  • walkor 2天前

    你这个是webman v1用 看v1手册

  • 小小袋鼠 2天前

    那 V2 版本 创建 项目 不是 composer create-project workerman/webman 这个命令吗?

  • walkor 2天前

    对,如果没创建V2版本一般是使用了有问题的composer镜像导致,比如阿里云composer镜像

  • 小小袋鼠 2天前

    那镜像告诉我一下。。 我刚才又重新安装了 又是 同样V1 版本

  • walkor 2天前

    composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/

  • 小小袋鼠 2天前

    E:\phpEnv\www>composer config -g repos.packagist composer https://mirrors.cloud.tencent.com/composer/

    E:\phpEnv\www>composer create-project workerman/webman ./allinoneV2
    Creating a "workerman/webman" project at "./allinoneV2"
    Installing workerman/webman (v1.6.3)

    • Downloading workerman/webman (v1.6.3)
    • Installing workerman/webman (v1.6.3): Extracting archive
      Created project in E:\phpEnv\www./allinoneV2
      Loading composer repositories with package information
      Updating dependencies
      Lock file operations: 6 installs, 0 updates, 0 removals
    • Locking monolog/monolog (2.10.0)
    • Locking nikic/fast-route (v1.3.0)
    • Locking psr/container (2.0.2)
    • Locking psr/log (1.1.4)
    • Locking workerman/webman-framework (v1.5.27)
    • Locking workerman/workerman (v4.1.17)
      Writing lock file
      Installing dependencies from lock file (including require-dev)
      Package operations: 6 installs, 0 updates, 0 removals
    • Downloading psr/log (1.1.4)
    • Downloading monolog/monolog (2.10.0)
    • Downloading workerman/workerman (v4.1.17)
    • Downloading psr/container (2.0.2)
    • Downloading nikic/fast-route (v1.3.0)
    • Downloading workerman/webman-framework (v1.5.27)
    • Installing psr/log (1.1.4): Extracting archive
    • Installing monolog/monolog (2.10.0): Extracting archive
    • Installing workerman/workerman (v4.1.17): Extracting archive
    • Installing psr/container (2.0.2): Extracting archive
    • Installing nikic/fast-route (v1.3.0): Extracting archive
    • Installing workerman/webman-framework (v1.5.27): Extracting archive

    麻烦 帮我看 对不对?

  • walkor 2天前

    没对,感觉你php版本太低了

  • 小小袋鼠 2天前

    php 是 8.1

  • walkor 2天前

    composer create-project workerman/webman:~2.0

  • 小小袋鼠 2天前

    可以了。。 配置 重启了一下

  • 小小袋鼠 2天前

    有QQ吗? 有问题 可以 随时 咨询一下

  • walkor 2天前

    页面底部有QQ群

×
🔝