【问题标题】:cant install yarn package from github无法从 github 安装 yarn 包
【发布时间】:2019-07-31 16:19:32
【问题描述】:

我正在尝试使用 yarn 从 GitHub 安装一个包。

我以前做过很多这件事,但是我在这个 repo 上没有成功:

https://github.com/coolwanglu/pdf2htmlEX

我已经尝试过但运气不佳:

yarn add git+https://github.com/coolwanglu/pdf2htmlEX
yarn add git+https://github.com/coolwanglu/pdf2htmlEX.git
yarn add https://github.com/coolwanglu/pdf2htmlEX
yarn add https://github.com/coolwanglu/pdf2htmlEX.git
yarn add https://coolwanglu@github.com/pdf2htmlEX
yarn add https://coolwanglu@github.com/pdf2htmlEX.git

【问题讨论】:

    标签: javascript npm package yarnpkg


    【解决方案1】:

    首先 - 如果你想要整个包:

    yarn add https://github.com/coolwanglu/pdf2htmlEX.git
    

    其次,您尝试过的方法不起作用,因为网址末尾有<br>

    yarn add git+https://github.com/coolwanglu/pdf2htmlEX<br> => yarn add git+https://github.com/coolwanglu/pdf2htmlEX


    Yarn 可以添加没有 package.json 的存储库,这与 Samuell 所说的相反。 (无法处理它们的是 npm - 创建 premature close error )。

    【讨论】:

    • 当我在这里写问题时,
      确定只是输入错误。我以前检查过这个选项,它没有用,但现在不知何故它工作了! :)
    【解决方案2】:

    你是用npm安装的吗?

    如果你有 npm,就这样做

    npm i yarn
    

    【讨论】:

      【解决方案3】:

      那是因为该存储库不是一个包。它缺少 package.json 。

      【讨论】:

      • 如果 repo 没有 package.json 它说我不能将它克隆到我的项目中?
      猜你喜欢
      • 2017-09-10
      • 2020-01-06
      • 1970-01-01
      • 1970-01-01
      • 2022-11-28
      • 2020-03-07
      • 2020-09-27
      • 2020-07-23
      • 2019-10-29
      相关资源
      最近更新 更多