【发布时间】:2021-07-02 13:50:35
【问题描述】:
我正在使用 yarn 构建一个站点并将其托管在 Netlify 上。我想将另一个 repo 集成为一个包,但我不想将该包放在 npm 注册表中,因为它的使用非常有限。我托管了package publicly via GitHub here 并将其添加到我的package.json:
"dependencies": {
"@ourjapanlife/findadoc-localization": "^1.0.0",
.
.
.
}
我可以在本地构建站点,并且一切运行良好。但是,当我部署到 Netlify 时,我收到以下错误:
10:38:06 PM: [1/4] Resolving packages...
10:38:06 PM: error Couldn't find package "@ourjapanlife/findadoc-localization" on the "npm" registry.
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
10:38:06 PM: Error during Yarn install
我创建了一个.yarnrc 文件,如下所示并将其添加到我的项目的根目录中:
@ourjapanlife:registry" "https://npm.pkg.github.com"
我对此进行了很多研究,但大多数建议都与 private GitHub repos 有关。我对这个包是公开的很好,但我不希望它集中托管,因为它只是一些对更广泛的社区几乎没有用的 i18n 文件。 This answer also looked promising,但从 .npmrc 切换到 .yarnrc 并没有解决我的问题。
【问题讨论】:
标签: yarnpkg netlify github-package-registry