无法从 github 安装 yarn 包

cant install yarn package from github

我正在尝试使用 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

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

您是否使用 npm 安装它?

如果你有 npm,就做

npm i yarn

首先 - 如果您想要整个包裹:

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 )。