Skip to content

Instantly share code, notes, and snippets.

@browniefed
Last active December 21, 2019 03:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save browniefed/90c0384b9e2cd61c4e1c909c9e7a1407 to your computer and use it in GitHub Desktop.
Save browniefed/90c0384b9e2cd61c4e1c909c9e7a1407 to your computer and use it in GitHub Desktop.

Consuming Package

Setup this as an .npmrc in a consumer

always-auth=true
@github-org:registry=https://npm.pkg.github.com/github-org/
_authToken=TOKEN
//npm.pkg.github.com/:_authToken=TOKEN

github-org is your org name to scope your packages to TOKEN is a personal access token to allow for reading from package repository. You can generate a token here https://github.com/settings/tokens

Then for Deploying

You'll need a token for authenticating with your account if you have 2 factor auth on.

"auth": "npm login --registry=https://npm.pkg.github.com"

Add this to your package.json of the thing you want deployed

"publishConfig": {
  "registry": "https://npm.pkg.github.com/"
},

Setup name to be "name": "@github-org/packagename",

Once authed with github and that is in package.json run npm publish.

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