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

Not working with private repos #36

Open
furstenheim opened this issue Feb 28, 2019 · 5 comments
Open

Not working with private repos #36

furstenheim opened this issue Feb 28, 2019 · 5 comments

Comments

@furstenheim
Copy link

Hi
Nice cli. I've tried updating a private npm package (by that I don't mean "private": true but rather that it is published to npm as a private library) but I get the following error:

An error occurred:
Error: Could not look up "my-private-package" in NPM registry

npm token is correctly set up, as I can publish using lerna.

@Anifacted
Copy link
Owner

Hi!

I must admit that I have not had this use-case in mind. The problem comes from the npm info call that the script does to look up the package and its versions:
https://github.com/Anifacted/lerna-update-wizard/blob/master/src/index.js#L209

Too bad that NPM does not seem to allow this, even when your token is correctly set up.

Can you please confirm that npm info @my-private/package gives you an error when running it on your machine (with the correct package name of course).

Fixing this problem would require some logic for bypassing the look-up stage for scoped, private packages, but that would mean that we do not have the list of versions to install from, and the rest of the script would have to be adjusted for that.

@furstenheim
Copy link
Author

furstenheim commented Feb 28, 2019

Can it be that the problem is in the npm client? I don't have npm correctly set up (faulty installation). I use yarn, which does work with yarn info @my-private/package and which is configure in lerna.json as "npmClient": "yarn"

@Anifacted
Copy link
Owner

Can it be that the problem is in the npm client?

Could be. I would suggest you try and get a healthy installation of NPM on your system, if possible. This would probably be a good thing for your setup in general :)

lernaupdate simply allows for using Yarn as the installer, since you may be using it for managing your dependencies, but it still depends on NPM internally for this lookup.

I suppose I could add a change to conditionally use Yarn for this lookup instead, but as far as I remember, older versions of Yarn returned a different output that NPM when using the info command, and that is why I stuck with NPM, (to avoid extra code complexity).

@jasonmobley
Copy link

Just ran into the same issue, seems that the registry config in my package's .npmrc is not honored by the npm info call that is made during lernaupdate.

The workaround I found was to provide my private registry config as an environment variable.
NPM_CONFIG_REGISTRY=https://my.privateregistry.org lernaupdate --non-interactive --dependency @private-scope/foo-package

@willingram
Copy link

Same issue, using Yarn and .npmrc as my usual private registry configuration file.

Solved in my case by adding .yarnrc to root with contents:

registry "https://example.com"

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

4 participants