Skip to content

Use CLI --@scope:registry flag to override scoped registry defined in .npmrc #219

Closed
@maryiam

Description

@maryiam

I'm using semantic-release-npm to publish a package on my Nexus registry. My package is scoped.

I have the following config my .npmrc that defines a rule for installing my scoped package (get it from Nexus proxy repository):

@myscope:registry=https://my-nexus-proxy-npm-group-url

If I use npm cli to publish my package, I am able to override the .npmrc :

  • with the --@scope:registry arg (and like mentioned here):
npm publish --@scope:registry=my-nexus-registry-URL
  • or with adding this config to my package.json
"publishConfig": {
    "@myscope:registry": "my-nexus-registry-URL"
  }

I am not able to achieve the same result with semantic-release-npm. The command that it uses to publish doesn't support the arg --@scope:registry, only the --registry arg is supported:

npm publish --userconfig /path/to/.npmrc --registry URL

Is there any way that I can configure semantic-release to use a scoped registry instead? Even when I try to configure the publishConfig attribute in my package.json like this

"publishConfig": {
    "@myscope:registry": "my-nexus-registry-URL"
  }

it's not working because the get-registry.js is taking into account only the registry attribute without supporting the scoped registry config.

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions