Skip to content

corepack use does not load COREPACK_NPM_REGISTRY from .corepack.env #741

@Gadzy

Description

@Gadzy

PROBLEM

corepack use does not load COREPACK_NPM_REGISTRY from .corepack.env

CONFIGURATION

  • macOS v15.6.1
  • NodeJS v22.19.0
  • corepack v0.34.0

DESCRIPTION

https://registry.npmjs.org is blocked by my company.
We use a private repository, and want to enforce it's use in our Node.js projects via a .corepack.env file.

COREPACK_NPM_REGISTRY=https://our.private.repo
$ corepack use pnpm
Internal Error: Error when performing the request to https://registry.npmjs.org/pnpm; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
    at fetch (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:22051:11)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async fetchAsJson (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:22065:20)
    at async fetchAvailableVersions (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:22009:20)
    at async fetchAvailableVersions2 (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:22146:14)
    at async /Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:23001:25
    at async Promise.all (index 1)
    at async Engine.resolveDescriptor (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:22998:22)
    at async UseCommand.execute (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:23469:22)
    at async UseCommand.validateAndExecute (/Users/gadzy/.local/share/fnm/node-versions/v22.19.0/installation/lib/node_modules/corepack/dist/lib/corepack.cjs:20258:22)
$ COREPACK_NPM_REGISTRY=https://our.private.repo corepack use pnpm
Installing [email protected] in the project...

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