Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support private repositories #6

Open
elicwhite opened this issue May 12, 2015 · 1 comment
Open

Support private repositories #6

elicwhite opened this issue May 12, 2015 · 1 comment

Comments

@elicwhite
Copy link

We are using Nexus as a private npm repository host. Nexus doesn't implement the npm list command, so we cannot get the list of published versions that way. We specify the repository url in the package.json file as

"publishConfig": {
    "registry": "http://ourhost.com/nexus/content/repositories/wf-npm/"
},

And can get the list of versions of our package with:

var pkg = require('./package.json');
var name = pkg.name;
var repository = pkg.publishConfig.registry;
var version = pkg.version;

request(repository + name, function (error, response, body) {
  body = JSON.parse(body);
  var versions = Object.keys(body.versions);

  if (versions.indexOf(version) === -1) { 
    // we don't have it.
  }
});

It would be great if this package would support this use case, either by handling a fall back way to look up packages, or letting us hook that search. Any thoughts?

@duckpuppy
Copy link

It seems that the publish package doesn't honor the publishConfig:registry in package.json - with only that in place, it's still trying to publish to the public npm repo. If I configure the repository in my .npmrc, then it publishes to the right repo... but then installs fail for me since npm install will then ALSO only use the .npmrc registry config, and not the public one. npm publish works fine with just the config in package.json, though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants