npmrc

Generate per-scope npm registry mappings for GitHub Packages without embedding credentials.

Updated Nov 20, 2025
One-click install
npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill npmrc
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: npmrc
Source: https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template/tree/main/.github/agents/app-starter/agents-context/skills/npmrc
Command: npx skills add https://github.com/sayali-ingle-pdl/adusa-ai-vuejs-app-template --skill npmrc

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) and references (resource) components.

What problem does it solve?

Conditionally generates per-scope npmrc configuration to map organization scopes to the GitHub Packages registry without storing tokens in the project.

Core Features & Use Cases

  • Generates organization-scoped registry mappings that ensure npm commands pull from the correct GitHub Packages registry.
  • Keeps authentication tokens in the user-level ~/.npmrc, preventing token leakage in source control.
  • Supports conditional execution when a component library is requested, with clear guidance on policy compliance.

Quick Start

Configure the per-scope registry mapping for your organization to enable npm installs from GitHub Packages without embedding credentials.

Frequently Asked Questions about npmrc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure npm to install scoped packages from the GitHub Packages registry?

To configure npm for GitHub Packages, you generate per-scope registry mappings in your project .npmrc that direct organization scopes to the GitHub Packages URL. This ensures npm install commands resolve scoped packages to the correct registry without embedding credentials.

Why does my npm token keep leaking into source control when using GitHub Packages?

Your npm token leaks into source control when authentication credentials are stored in the project-level .npmrc. To prevent token leakage, keep authentication tokens in the user-level ~/.npmrc and only store per-scope registry mappings in the project directory.

What is the correct .npmrc format for mapping an organization scope to a custom registry?

The correct .npmrc format for mapping an organization scope uses the @scope:registry=https://registry-url/ syntax. This configuration redirects npm to fetch packages published under that specific scope from the designated GitHub Packages registry instead of the default npm registry.

Do I need a personal access token to install private component libraries from GitHub Packages?

Yes, you need a personal access token with the read:packages scope to install private component libraries from GitHub Packages. This token must be configured in your user-owned ~/.npmrc file to authenticate registry requests without exposing credentials in the project repository.

Can I set up per-scope registry mappings for npm in a CI environment without storing tokens in the project?

Yes, you can set up per-scope registry mappings in CI by generating project-level .npmrc files with only the scope-to-registry URLs, while injecting the read:packages authentication token into the user-level ~/.npmrc through secure CI environment variables.

When should I not use a project-level .npmrc for GitHub Packages authentication?

You should not use a project-level .npmrc for GitHub Packages authentication when it requires storing tokens directly in the file. Storing tokens in project files risks accidental exposure in version control, so authentication should always remain in the user-level ~/.npmrc.