Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] npm 7.x ignores publishConfig.registry #1937

Closed
marcusds opened this issue Oct 9, 2020 · 19 comments
Closed

[BUG] npm 7.x ignores publishConfig.registry #1937

marcusds opened this issue Oct 9, 2020 · 19 comments
Assignees
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release

Comments

@marcusds
Copy link

marcusds commented Oct 9, 2020

Current Behavior:

npm publish does not follow publishConfig.registry, if registry is .npmrc it will try to publish to that, if not npm.org.

Expected Behavior:

npm publish publish to defined publishConfig.registry as it did in 6.x.

Steps To Reproduce:

  • Install npm@latest-7
  • Set publishConfig.registry IE: "publishConfig": { "registry": "https://..." }
  • Run npm publish

Environment:

  • OS: Windows 10
  • Node: 12.18.1
  • npm: 7.0.0-rc.3
@marcusds marcusds added Bug thing that needs fixing Needs Triage needs review for next steps Release 7.x work is associated with a specific npm 7 release labels Oct 9, 2020
@darcyclarke darcyclarke removed the Needs Triage needs review for next steps label Oct 11, 2020
@darcyclarke darcyclarke added this to the OSS - Sprint 17 milestone Oct 11, 2020
@nlf nlf self-assigned this Oct 12, 2020
@nlf
Copy link
Contributor

nlf commented Oct 16, 2020

this should be resolved! can you update to 7.0.1 with npm i -g npm@next-7 and see if it takes care of it for you?

@thw0rted
Copy link

I'm using 7.3.0 and still seeing this behavior, specifically, it fails with ENEEDAUTH immediately when I run npm publish, even though I'm logged in to the (private) repo specified in publishConfig.registry.

Reverting to 6.14.10 fixes it, as does manually specifying npm publish --registry=.... I haven't tried an earlier version of 7 (like 7.0.1) to see if it worked in October but re-broke afterwards.

@transcranial
Copy link

I can confirm this bug exists in 7.3.0.

@MikaelX
Copy link

MikaelX commented Jan 21, 2021

I can confirm this bug exists in 7.4.0, and 7.4.3

@StefanLiebenberg
Copy link

This works for me in 7.2.0 and breaks in 7.3.0.

@robross0606
Copy link

I can confirm this still exists with 7.5.2 which is now released to GA and breaking 60+ projects on our ci server.

@wraithgar
Copy link
Member

The ENEEDAUTH bug is fixed in #2602

@HoplaGeiss
Copy link

This issue still exist in 7.5.4

@rndm2
Copy link

rndm2 commented Feb 24, 2021

It is still reproduced in 7.5.6
Any updates?

@nlf
Copy link
Contributor

nlf commented Feb 24, 2021

is the problem you're seeing that we're actually publishing to the wrong registry? or are you getting the ENEEDAUTH error?

@nlf nlf reopened this Feb 24, 2021
@nlf nlf closed this as completed Feb 24, 2021
@rndm2
Copy link

rndm2 commented Feb 24, 2021

I am still getting ENEEDAUTH error and npm ignore package.json's publish settings.
Reverted to 6.x.x

@nlf
Copy link
Contributor

nlf commented Feb 24, 2021

would you mind opening a new issue? the ENEEDAUTH thing is distinct from this original bug. i'll make sure we address this for the next release

@rndm2
Copy link

rndm2 commented Feb 24, 2021

I am not sure how to get full publish log.
npm publish --verbose do not show me repo address and http(s) request

@nlf
Copy link
Contributor

nlf commented Feb 24, 2021

npm publish --loglevel=silly should give you a lot more information

@HoplaGeiss
Copy link

For me, the issue still is that it's being published to the wrong registry.

@nlf
Copy link
Contributor

nlf commented Feb 24, 2021

For me, the issue still is that it's being published to the wrong registry.

would you mind also opening a new issue? if you can come up with a small reproduction case for us that would be amazing, i haven't been able to reproduce the case where we're publishing to the wrong registry

@rndm2
Copy link

rndm2 commented Feb 24, 2021

I'll do this tomorrow morning.

@GideonMax
Copy link

would you mind opening a new issue? the ENEEDAUTH thing is distinct from this original bug. i'll make sure we address this for the next release

actually, I don't think it's a different issue, it's because the user is authorized for publishConfig.registry but not authorized for the default registry (npm I'm assuming)

@tbenyon
Copy link

tbenyon commented Dec 27, 2023

If anyone else lands hear as I did I found running npm config set registry <registry url> fixed my issue but I don't understand why.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug thing that needs fixing Release 7.x work is associated with a specific npm 7 release
Projects
None yet
Development

No branches or pull requests