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

cli
help-wanted
priority:low
triaged

(Elad Chen) #1

What I Wanted to Do

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

.npmrc:

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

package.json:

{
  ...
  "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)

Details

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: '5.8.283.41',
  zlib: '1.2.11' }

$ node -p process.platform
darwin

(Elad Chen) #2

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.


(system) #3

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.