Composer [InvalidArgumentException]找不到包mtibben / html2text

时间:2017-11-14 14:41:58

标签: laravel composer-php

我尝试通过composer将html2text安装到我的laravel应用程序中。这是html2text存储库的链接。 https://github.com/mtibben/html2text

我已尝试composer require mtibben/html2text发出此错误:

  

[InvalidArgumentException]
  找不到任何版本的软件包mtibben / html2text   最小稳定性(稳定)。检查包裹拼写或您的   最小稳定性

此外,我已尝试composer require https://github.com/mtibben/html2text.git发出此错误:

  

[UnexpectedValueException]
  无法解析版本约束//github.com/mtibben/html2text.git:   无效的版本字符串“//github.com/mtibben /html2text.git”

enter image description here

如何安装html2text?

3 个答案:

答案 0 :(得分:2)

它是一个php包,你不能用composer require安装

你可能想阅读本教程

http://laraveldaily.com/how-to-use-external-classes-and-php-files-in-laravel-controller/

答案 1 :(得分:1)

您的目录中是否已有 composer.json 文件?如果没有,这可能是错误,因为在此文件中,您将配置要安装到项目中的软件包版本。

第二个例外提供了该缺失版本的提示!

如果您有composer.json文件,请将其内容添加到您的问题中,以便我们查看。

您可以在此处找到更多信息:

https://getcomposer.org/doc/01-basic-usage.md#composer-json-project-setup

答案 2 :(得分:1)

我遇到了同样的问题。 发布版本的创建和任何标签都没有帮助。

我的解决方案原来是从上一个版本更新作曲家。

相关问题