Private NPM Registry
If you rely on private NPM packages from your organization, you need to configure authentication to access them during deployment. To do so, create a local ~/.npmrc file in your project root.
Example: Private NPM Registry from GitHub
For packages published under your GitHub organization (e.g., @your-company/package-name):
.npmrc
@your-org-name:registry=https://npm.pkg.github.com/
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_TOKENConfiguration steps:
- Replace
@your-org-namewith your actual GitHub organization or username - Replace
YOUR_GITHUB_TOKENwith your GitHub personal access token that hasread:packagespermission - Place this
.npmrcfile in your project root directory
This configuration tells npm to use GitHub’s package registry for all packages under your organization’s scope. All other packages still come from the default npm registry.