1.0.0 • Published 3 years ago
npmregistryconsumerpoc v1.0.0
Accessing a private npm registry
To access a private npm registry add an .npmrc config file to your repo.
In the set up guide for the npm registry, I mentioned that having a SCOPE was incredibly important for you package name. This is because in your .npmrc, you will specify which registry to use for that specific scope:
@SCOPE:registry=https://npm.pkg.github.com/SCOPETypically this will be your org name or your user name.
If this registry is private, you will need to be authorized to read from this repo.
To do this you add
//npm.pkg.github.com/:_authToken=AUTH_TOKENto your .npmrc, where AUTH_TOKEN is a token generated from github.
As I mentioned in the guide for creating an npm registry through github, doing this means the .npmrc should be encrypted or otherwise not included in the repo (e.g. added to the .gitignore)
1.0.0
3 years ago