Create .npmrc
in your PROJECT_ROOT
//npm.pkg.github.com/:_authToken=<YOUR_GITHUB_TOKEN>
- Please to https://github.com/settings/tokens
- Generate new token
- Selected read:packages [required]
- Generate Token
- Copy the generated token and paste it into your YOUR_GITHUB_TOKEN in
.npmrc
Add a registry to the end of .npmrc
in PROJECT_ROOT
//npm.pkg.github.com/:_authToken=<YOUR_GITHUB_TOKEN>
"@tsubasa:registry" "https://npm.pkg.github.com"
Create .yarnrc
in your PROJECT_ROOT
"@tsubasa:registry" "https://npm.pkg.github.com"
$ npm install @tsubasa/example-npm-github-package
$ yarn add @tsubasa/example-npm-github-package
import Hello from '@tsubasa/example-npm-github-package'
Hello('foo');
// Hello, foo!