I'm building a site with yarn and hosting it on Netlify. I want to integrate another repo as a package, but I'd rather not put that package on the npm registry because it's very limited use. I hosted the package publicly via GitHub here and added it to my package.json
:
"dependencies": {
"@ourjapanlife/findadoc-localization": "^1.0.0",
.
.
.
}
I can build the site locally and everything runs fine. However, when I deploy to Netlify, I get the following error:
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
I've created a .yarnrc
file as follows and added it to the root of my project:
@ourjapanlife:registry" "https://npm.pkg.github.com"
I've researched this a lot, but most of the advice relates to private GitHub repos. I'm fine with this package being public, but I don't want it centrally hosted because it's just some i18n files of little use to the wider community. This answer also looked promising, but switching from .npmrc
to .yarnrc
did not solve my issue.