Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 19 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save ThallyssonKlein/8d24eb20c101c1f20036cee77e24524c to your computer and use it in GitHub Desktop.
Save ThallyssonKlein/8d24eb20c101c1f20036cee77e24524c to your computer and use it in GitHub Desktop.
# How to consume Github Package private registry with yarn?
Create an .npmrc file in the same location as the package.json with this content.
```
registry=https://registry.yarnpkg.com/
@<username>:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=<your auth token>
always-auth=true
```
## How to get the token?
https://github.com/settings/tokens
@chillaxdev
Copy link

+1

@Marcos-Barranquero
Copy link

Thanks it worked.

Careful, other tutorials suggest to use the "@registry=https://npm.pkg.github.com/" syntax instead of "@:registry=https://npm.pkg.github.com". That was an issue for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment