npm-api icon indicating copy to clipboard operation
npm-api copied to clipboard

npm-api does not respect `.npmrc` files

Open mpiroc opened this issue 4 years ago • 4 comments

It's common to install packages from multiple registries. For example, an organization may wish to install packages from @my-org from their own registry, while still using the official npm registry for other packages.

You can achieve this with a line in your .npmrc that looks something like this:

@my-org:registry=https://npm.pkg.github.com

With npm-api, the registry is hard-coded in lib/config.js. It does not look at .npmrc, and does not provide a way to manually override the registry location/add a second location.

mpiroc avatar May 09 '20 22:05 mpiroc

Also note that for private registries, the auth tokens are also specified in .npmrc.

mpiroc avatar May 09 '20 22:05 mpiroc

Ha, thanks for filing this. Just stumbled upon this repository and it was the very first question I had. If it doesn't look at npmrc file contents, what does it use? 😳

markcellus avatar Jan 27 '21 22:01 markcellus

~FWIW, I just came across https://www.npmjs.com/package/npm-registry-fetch which seems to fulfill the need.~ nevermind. It doesn't respect npmrc files.

markcellus avatar Jan 27 '21 22:01 markcellus

We would also need this feature 🙈

ChrizzDF avatar Aug 17 '22 08:08 ChrizzDF