Skip to content

private registries support #148

@cherniavskii

Description

@cherniavskii

The problem

When using private registry with authorization required (e.g. Nexus or verdaccio), it's impossible to use patch-package, when using per-project auth

The reason is that patch-package tries to install package in temp folder, but since there's no .npmrc file with auth token - 401 error is thrown:

npm ERR! code E401

Note, that when using private registries, all the packages from NPM registry are usually proxied. Installing any of them requires user to be authorized.

Potential solution

I've managed to make it work locally by copying .npmrc file to the tmp repo.
My suggestion is to check if .npmrc file exists and copy it to temp repo. Also, maybe it's worth to consider copying .yarnrc as well

I can submit a PR :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions