Skip to content

Support for private npm registries #116

@xpure-sklatt

Description

@xpure-sklatt

Hi,
we're using a private npm registry where authentication is required and we're struggling by fetching the version info from there.

At the moment it seems like next-update is using the .npmrc file to get the registry url, so I tried to put user and password into the url, like: https://user:pass@my-custom-registry.com within my .npmrc file, but that still resulted in a timeout. Problem here is that https is always replaced by http, which is not supported by our registry.

I finally fixed it by editing your registry.js file (line 182):

// replaced this:
// npmUrl = npmUrl.replace(/^https:/, 'http:').trim()
// var url = npmUrl + escapeName(name)

// with this:
var user = encodeURIComponent('me@foo.bar');
var pass = encodeURIComponent('123abc?');
var registryBase = 'my-custom-registry.com/api/npm/';
var url = 'https://' + user + ':' + pass + '@' + registryBase + escapeName(name);

I also needed to increase the MAX_CHECK_TIMEOUT on line 313.

Is there a chance to implement a way of configuring a custom registry with custom credentials, https support and custom timeout value? We'd really love to use next-update in our project! It's a great tool!

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