Skip to content

Configure npm registry via .npmrc #642

Description

@Emptymu

Affected Packages

pkg:@changesets/cli

Problem

Looks like we can only get the npm registry from packageJson.publishConfig or process.env.npm_config_registry when running npm info. Is there a way to get npm registry from .npmrc file?

Screen Shot 2021-09-28 at 9 06 29 PM

Also, is npm_config_registry safe to rely on? Because it's not documented.

Proposed solution

Read npm registry in the following priorities:

  1. packages/my-package/packageJson.publishConfig
  2. packages/my-package/.npmrc
  3. root/.npmrc

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions