Skip to content

Support for HTTP Protocol in Private Registries #46

@WooWan

Description

@WooWan

We use a private npm registry with HTTP protocol internally, but napi-postinstall only supports HTTPS, causing this error:

node:_http_client:190
    throw new ERR_INVALID_PROTOCOL(protocol, expectedProtocol);
          ^

TypeError [ERR_INVALID_PROTOCOL]: Protocol "http:" not supported. Expected "https:"
    at new ClientRequest (node:_http_client:190:11)
    at request (node:https:381:10)
    at Object.get (node:https:417:15)
    at /Users/changwan/.yarn/berry/cache/napi-postinstall-npm-0.3.2-2ad51f7373-10c0.zip/node_modules/napi-postinstall/lib/index.js:17:14
    at new Promise (<anonymous>)
    at fetch (/Users/changwan/.yarn/berry/cache/napi-postinstall-npm-0.3.2-2ad51f7373-10c0.zip/node_modules/napi-postinstall/lib/index.js:15:12)
    at ClientRequest.<anonymous> (/Users/changwan/.yarn/berry/cache/napi-postinstall-npm-0.3.2-2ad51f7373-10c0.zip/node_modules/napi-postinstall/lib/index.js:20:17)
    at Object.onceWrapper (node:events:639:26)
    at ClientRequest.emit (node:events:524:28)
    at HTTPParser.parserOnIncomingClient (node:_http_client:710:27) {
  code: 'ERR_INVALID_PROTOCOL'
}

Request

Could you add HTTP protocol support for private/internal registries? Many corporate environments use HTTP registries behind firewalls where HTTPS isn't necessary.

Environment

Node.js: v22.12.0
napi-postinstall: 0.3.2
Yarn with private HTTP registry

Thanks for considering this!

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