How to escape port in custom npm registry URL?

Discussão em 'Angular' iniciado por Alfredo Morales, Agosto 13, 2025.

  1. In my organization we have a Nexus Registry for our npm libraries, it's located at this URL: https://10.1.0.10:4434/repository/npm-group/

    I'm trying to install a lib from that repo in a dummy project but npm keeps deleting the port section and forces default port for HTTPS (443).

    I have tried:

    npm install my-lib@0.0.2-13 --registry=https://10.1.0.10:4434/repository/npm-group


    and adding the dependency in my package files and setting the registry in .npmrc like:

    registry=https://10.1.0.10:4434/repository/npm-group


    but either way I'm getting:

    npm error network request to https://10.1.0.10/repository/npm-group/my-lib/-/my-lib-0.0.2-13.tgz failed, reason: connect ETIMEDOUT 10.1.0.10:443


    If I go directly to the URL with the correct port, I can download the .tgz file.

    How do I have to set the URL so npm parses it correctly? Does it matter if the cert is self-signed? Does it support custom ports or does it have to be 443?

    I'm using npm 11.5.2 with Node v22.14.0.

    Continue reading...

Compartilhe esta Página