dongyi2083
2016-12-16 21:16
浏览 238
已采纳

无法使用composer安装wp-cli

Trying to install wp-cli globally - but it does not work:

 $ composer global require wp-cli/wp-cli
Changed current directory to /home/self/.composer
Using version ^1.0 for wp-cli/wp-cli
./composer.json has been created
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 wp-cli/wp-cli ^1.0 -> satisfiable by wp-cli/wp-cli[v1.0.0].
    - Conclusion: remove symfony/console v3.0.2
    - Conclusion: don't install symfony/console v3.0.2
    - wp-cli/wp-cli v1.0.0 requires symfony/console ~2.7 -> satisfiable by symfony/console[v2.7.0, v2.7.1, v2.7.10, v2.7.11, v2.7.12, v2.7.13, v2.7.14, v2.7.15, v2.7.16, v2.7.17, v2.7.18, v2.7.19, v2.7.2, v2.7.20, v2.7.21, v2.7.22, v2.7.3, v2.7.4, v2.7.5, v2.7.6, v2.7.7, v2.7.8, v2.7.9, v2.8.0, v2.8.1, v2.8.10, v2.8.11, v2.8.12, v2.8.13, v2.8.14, v2.8.15, v2.8.2, v2.8.3, v2.8.4, v2.8.5, v2.8.6, v2.8.7, v2.8.8, v2.8.9].
    - Can only install one of: symfony/console[v2.7.0, v3.0.2].
    ...
    - Can only install one of: symfony/console[v2.8.9, v3.0.2].
    - Installation request for symfony/console (locked at v3.0.2) -> satisfiable by symfony/console[v3.0.2].


Installation failed, deleting ./composer.json.

edit

composer global why symfony/console

Changed current directory to /home/self/.composer
consolidation/annotated-command  2.2.2   requires  symfony/console (^2.8|~3)    
consolidation/log                1.0.3   requires  symfony/console (~2.5|~3.0)  
consolidation/output-formatters  3.1.5   requires  symfony/console (~2.5|~3.0)  
consolidation/robo               1.0.5   requires  symfony/console (~2.8|~3.0)  
laravel/installer                v1.3.1  requires  symfony/console (~2.3|~3.0)  
victorjonsson/markdowndocs       1.3.7   requires  symfony/console (>=2.6) 

图片转代码服务由CSDN问答提供 功能建议

尝试全局安装wp-cli - 但它不起作用:

  $ composer global require wp-cli / wp-cli 
更改当前目录到/home/self/.composer
使用版本^ 1.0 for wp-cli / wp-cli 
./composer.json已创建 
使用包信息加载作曲家存储库
更新依赖关系(包括require-dev)
您的要求无法解析为可安装的包集。
 
问题1 
  -  wp-cli / wp-cli的安装请求^  1.0  - >  wp-cli / wp-cli [v1.0.0]可以满足。
  - 结论:删除symfony / console v3.0.2 
  - 结论:不要安装symfony / console v3.0.2 
  -  wp-cli / wp  -cli v1.0.0需要symfony / console~2.7  - >  symfony / console可以满足[v2.7.0,v2.7.1,v2.7.10,v2.7.11,v2.7.12,v2.7.13,v2.7.14,v2.7.15,v2.7.16,v2.7.17,v2.7.18,  v2.7.19,v2.7.2,v2.7.20,v2.7.21,v2.7.22,v2.7.3,v2.7.4,v2.7.5,v2.7.6,v2.7.7,v2.7.8,v2.7.9,v2。  8.0,v2.8.1,v2.8.10,v2.8.11,v2.8.12,v2.8.13,v2.8.14,v2.8.15,v2.8.2,v2.8.3,v2.8.4,v2.8.5,v2.8.6,  v2.8.7,v2.8.8,v2.8.9]。
  - 只能安装以下之一:symfony / console [v2.7.0,v3.0.2]。
 ... 
  - 只能安装以下内容之一:symfony  /console[v2.8.9,v3.0.2]。
  -  symfony / console的安装请求(锁定在v3.0.2) - >  symfony / console [v3.0.2]可以满足。
 
 
安装失败,删除./composer.json.
nn

编辑

composer global为什么symfony / console

 将当前目录更改为/home/self/.composer
consolidation/annotated-command 2.2  .2需要symfony / console(^ 2.8 | ~3)
consolidation / log 1.0.3需要symfony / console(~2.5 | ~3.0)
consolidation / output-formatters 3.1.5需要symfony / console(~2.5 | ~3.0)  )
consolidation / robo 1.0.5需要symfony / console(~2.8 | ~3.0)
laravel / installer v1.3.1需要symfony / console(~2.3 | ~3.0)
victorjonsson / markdowndocs 1.3.7需要symfony / console(&gt  ; = 2.6)
   
 
  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 邀请回答

2条回答 默认 最新

  • dongping1012 2016-12-17 12:28
    已采纳

    I was able to solve the problem by removing the global composer.lock and run a composer global install

    点赞 评论
  • duanfengshang1088 2016-12-16 21:44

    There is a very cool command in Composer: composer why

    I invite you to provide the result of composer why symfony/console. Somehow something locked it to a specific version (3.0.2), but WP is targeting an older version...

    If your tools are conflicting, you need to have a look at what would happen when changing the wp-cli to symfony/console 3, and then create a PR on wp-cli. I can guide you through this process if needed.

    点赞 评论

相关推荐 更多相似问题