By Kieran L
I have a private library built and published to the private Github packages registry, I was expecting to be able to specify a npmrc with my scoped registry and auth like this;
//npm.pkg.github.com/:_authToken=${TOKEN_FOR_GITHUB}
but if I use .npmrc with a yarn.lock in the project it errors with,
‘Warning: a .npmrc file was found. yarn does not read .npmrc files, use .yarnrc instead if needed.’
So I tried making a .yarnrc file and that just got me a 401 response, and I also tried a .yarnrc.yml and that also got me a 401.
I cant see another question with this answered and my project depends on being able to install this package
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
Hello @klewin23
In order to build from private repositories you need to have the right permissions.
To run through the Github auth process again you can visit https://cloud.digitalocean.com/apps/github/install
If you have multiple orgs associated with your Github account, be sure to choose the org that your private repo is in.
Then on the Repository Access screen, either choose “All Repositories” or specifically select the now-private repo you want to deploy.
Regards
Hi,
I have also been struggling with this. To be clear, this is not talking about building from a private github repo that @alexdo is referring to, rather a npm package repository.
I have had success in switching to using npm, rather than yarn, to install. However this is not ideal as we prefer to use yarn in our workflows.
I have yet to find a way to successfully use yarn. It is remarkably frustrating. One solution might be, to use yarn locally, but npm in the build process. I’m going to look into .gitignore the yarn.lock file, and include a hook to use
npm i --package-lock-only
To generate a package.lock file for the build process to use npm.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.