Skip to content
This repository has been archived by the owner on Aug 11, 2022. It is now read-only.

Allow custom registry when running npx #19113

Open
1 of 3 tasks
frediana opened this issue Nov 9, 2017 · 2 comments
Open
1 of 3 tasks

Allow custom registry when running npx #19113

frediana opened this issue Nov 9, 2017 · 2 comments
Labels

Comments

@frediana
Copy link

frediana commented Nov 9, 2017

I'm opening this issue because:

  • npm is crashing.
  • npm is producing an incorrect install.
  • npm is doing something I don't understand.
  • [x ] Other (see below for feature requests):

What's going wrong?

How can the CLI team reproduce the problem?

Hello,

I have an issue running npx command on a specific package hosted on a custom registry (not npmjs.org)

Context:

I'm using a custom NPM module registry: Nexus, inside my project I have a .npmrc with the registry parameter filled.
We have some scoped packages, let says
The module contains some binaries, let says foo.sh
Problem:

If I clean my node_module, and run the following command:
npx -p @mycompany/tools foo
I get a 404, and when I look at the logs I can see that the request is made to //registry.npmjs.org/ not my local repository.

I cannot see any --registry option or so.

Proposition:

I think the registry should be taken fron .npmrc if exists
Do you think we could add a registry option to allow custom registry?
If I can help developping a solution, with some little guidance and aprovals I would be happy to help

Regards,

Adrien

@kenany kenany added the npx label Nov 9, 2017
@elclanrs
Copy link

elclanrs commented Nov 20, 2017

I have the same issue. The registry config in .npmrc does not work with npx, but the environment config variable does interestingly:

npm_config_registry=http://path/to/registry npx @scoped/package

This works for my use case because our registry proxies the npm registry, but it breaks our user's workflow by cloning the repo with an npmrc inside.

At the very least npx should support npmrc.

@joeychia
Copy link

joeychia commented Mar 2, 2018

I have the same problem with OP. Please honor registry in .npmrc

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

Successfully merging a pull request may close this issue.

4 participants