Open bbohling opened 7 years ago
Should work yes, but never tested as I don't use a private npm registry. Happy to merge a PR for a fix if there's a problem, but you're pretty much on your own when using a private npm registry.
Did you probably missed the namespace for the private registry?
const updateNotifier = require('update-notifier');
updateNotifier({
pkg: {
name: '@myPrivateRegistry/my-package',
version: '1.0.0'
}
}).notify();
had the same option with a private repo configured in .npmrc even the example.js does not work with this setup.
I don't use scoping in this context. The registry is configured to return private and external packages within the same url
I am having issues used a scoped Sinopia server as well (similar setup as @ChrisEbert from the looks of it).
I've debugged this issue. Here are my findings:
cert
and key
I will create an issue there
So.. any solutions here? :)
nobody seems very interested in fixing this issue or providing suggestions for a fix. As we are not using a private repo anymore, I will not create any PRs.
I checked the problem and the lack of support comes from the latest-version
package, and they don't wanna add support..
https://github.com/sindresorhus/latest-version/issues/9
Question is, if I'll fork the package and will create an alternative, will I waste my time or will it be used?
I add .npmrc
in my project,and it works in our company's registry.
Returns undefined
may caused by cache, you can try setting the option updateCheckInterval
to change how often to check for updates.
like this:
const notifier = updateNotifier({ pkg, updateCheckInterval: 1 })
I suddenly faced the same problem, but as @huruji said - .npmrc
with registry
entry solved it.
Same problem for me. This module wouldn't show updates from my private repository (Nexus).
The reason why it did not work was hidden in the outputs of the spawned process to request the npm registry. Changing this line: https://github.com/yeoman/update-notifier/blob/71a3f197c46ba8e82fd5c00bcc6ccf88f437de9f/index.js#L99 to 'inherit' revealed the problem:
GotError [RequestError]: self signed certificate
I was using https with a self signed certificate to access my private repository. The quick (and insecure) solution was to add
process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0';
before calling updateNotifier
.
I forked this repo, and add registryUrl param to specify private npm registry, just see https://www.npmjs.com/package/update-notifier2
const updateNotifier = require('update-notifier2');
updateNotifier({
pkg,
registryUrl: 'http://npm.example.com',
}).notify({
installCommand: `cnpm i -g ${pkg.name} --registry=${registryUrl}`,
})
Hi, We have the same issue here that the private registry not working, is there any solutions?
I forked this repo, and add registryUrl param to specify private npm registry, just see https://www.npmjs.com/package/update-notifier2
const updateNotifier = require('update-notifier2'); updateNotifier({ pkg, registryUrl: 'http://npm.example.com', }).notify({ installCommand: `cnpm i -g ${pkg.name} --registry=${registryUrl}`, })
i think,custom config update registry should implement on main branch
We are in 2022 and still not working with private repository even though some solution have been proposed in other forks. Am i missing something?
We are in 2022 and still not working with private repository even though some solution have been proposed in other forks. Am i missing something?
@msalafia use this https://www.npmjs.com/package/update-notifier2
Use .npmrc can solve this. I solve this problem by check the source code。 It use "package-json" package 。 this function supports two ways for setting reigstryUrl. use user's options or use .npmrc。"update-notifier" only support .npmrc
I am using v1.0.3 with a CLI utility that has been added to our private npm registry. The registry is defined both in my global (user) .npmrc and local CLI utility .npmrc but it is still coming back as undefined when I use:
Is there a step I am missing? Based on #32 I thought it should work with private registries. Maybe I'm wrong though.