-
Notifications
You must be signed in to change notification settings - Fork 123
Description
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.
Activity
pvdlg commentedon Nov 13, 2019
The config
@myscope:registry
allow to set a registry that will be used only package in@scope
.As you can see in this test we do read the
@myscope:registry
property from.npmrc
and that's the value that is passed to--registry
.So if you have
@myscope:registry=https://my-nexus-proxy-npm-group-url
in your.npmrc
and your package is in the scope@myscope
then the registryhttps://my-nexus-proxy-npm-group-url
will be used for the publish step.Please provide:
~/.npmrc
and./.npmrc
@semantic-release/npm
you are usingpvdlg commentedon Nov 28, 2019
Closing as no response provided. Feel free to re-open if you still experience an issue and provide the info requested above.
brncsk commentedon Sep 29, 2020
I think this should be reopened. The scoped registry should be picked up from
package.json
'spublishConfig
as well as from.npmrc
.I've just run into this, and this issue is clearly stated in the original report as well.
jameshartig commentedon Mar 5, 2021
We're running into this issue. Setting
NPM_CONFIG_REGISTRY
does not correctly set--@scope:registry=
and just uses--registry
instead.NNNaix commentedon Jun 25, 2021
Hello, @jameshartig .
Just uses
--registry
is not enough beacuse if setting@scope:registry
in.npmrc
it will always have a higher priority.But the scope registry in
.npmrc
is setting for installing. For example i develop a boilerplate and i don't wantnpm publish
using registry from.npmrc
, and--registry
will not work.fix: respect scoped registries from publishConfig