npm Community Forum (Archive)

The npm community forum has been discontinued.

To discuss usage of npm, visit the GitHub Support Community.

Override .npmrc "@scope:registry" using package.json "publicConfig" property

What I Wanted to Do

Tried to override the project .npmrc “@scope:registry” value by specifying another value
Using package.json.


@my-scope:registry = https://corporate-install-only-registry.exmaple


  "publicConfig": {
     "@my-scope:registry": "https://corporate-publish-only-registry.exmaple"

What Happened Instead

The value being used by npm install command is the one that appears in the .npmrc file.

In other words:
Publishing uses this registry value: https://corporate-install-only-registry.exmaple (.npmrc)
Instead of using this: https://corporate-publish-only-registry.exmaple (package.json)


My assumption is based on these: issue-231 & issue-10117

Platform Info

$ npm --versions
{ '@my-scope/my-module': '0.0.1',
  npm: '6.2.0',
  ares: '1.10.1-DEV',
  cldr: '31.0.1',
  http_parser: '2.7.0',
  icu: '59.1',
  modules: '57',
  node: '8.2.1',
  openssl: '1.0.2l',
  tz: '2017b',
  unicode: '9.0',
  uv: '1.13.1',
  v8: '',
  zlib: '1.2.11' }

$ node -p process.platform

Is there anything that I can do to help resolve this? I just need a push in the right direction, as I’m not sure where to start.