`npm unpublish` does not respect publishConfig setting for registry #3032

Closed
suarasaur opened this Issue Jan 3, 2013 · 12 comments

Comments

Projects
None yet
8 participants
@suarasaur

Running npm publish in a package's directory will get registry settings by reading the publishConfig section of package.json. However, running npm unpublish does not look in package.json and instead uses the default global registry.

Would you accept a patch to make npm unpublish's registry configuration registration behave like npm publish?

@mfncooper

This comment has been minimized.

Show comment
Hide comment
@mfncooper

mfncooper Jan 6, 2013

Contributor

That would make sense to me.

Contributor

mfncooper commented Jan 6, 2013

That would make sense to me.

@matthiasg

This comment has been minimized.

Show comment
Hide comment
@matthiasg

matthiasg Mar 25, 2014

@jden did you send a patch ?

@jden did you send a patch ?

@suarasaur

This comment has been minimized.

Show comment
Hide comment
@suarasaur

suarasaur Mar 26, 2014

@matthiasg never heard back; didn't write a patch

@matthiasg never heard back; didn't write a patch

@suarasaur suarasaur closed this Mar 26, 2014

@Evgenus

This comment has been minimized.

Show comment
Hide comment
@Evgenus

Evgenus Sep 12, 2014

Why that was closed?

Evgenus commented Sep 12, 2014

Why that was closed?

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Sep 12, 2014

Contributor

@Evgenus this is superseded by supporting a per-project .npmrc file (#5077). You can set registry = or @scope:registry = in there.

Contributor

othiym23 commented Sep 12, 2014

@Evgenus this is superseded by supporting a per-project .npmrc file (#5077). You can set registry = or @scope:registry = in there.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Sep 12, 2014

Contributor

Or, rather, it was handled on #4751.

Contributor

othiym23 commented Sep 12, 2014

Or, rather, it was handled on #4751.

@cstamas

This comment has been minimized.

Show comment
Hide comment
@cstamas

cstamas Sep 26, 2014

per-project .npmrc is not the solution for this bug IMO. The use case "I do want to fetch from one registry, but am publishing to another one" is still broken.

A project being set up using publishConfig in package.json, as it was the recommended way by npm doco is still broken, it cannot properly unpublish.

Or is there another way to make npm fetch from one registry but publish to another I am not aware of?

cstamas commented Sep 26, 2014

per-project .npmrc is not the solution for this bug IMO. The use case "I do want to fetch from one registry, but am publishing to another one" is still broken.

A project being set up using publishConfig in package.json, as it was the recommended way by npm doco is still broken, it cannot properly unpublish.

Or is there another way to make npm fetch from one registry but publish to another I am not aware of?

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Sep 26, 2014

Contributor

This is what I get for reading the body of an issue (which had a very important typo before I fixed it) and not looking carefully at its title. While this bug / feature request is not a big, earth-shattering deal, I am generally sympathetic to the idea that operations inside npm should be symmetric. As such, if npm publish reads publishConfig data, then so should npm unpublish. That doesn't mean that I'll have time to get to it anytime soon, though, so if somebody (@jden?) wants to take a whack at putting together a PR, I'd be happy to work with them to land it.

Contributor

othiym23 commented Sep 26, 2014

This is what I get for reading the body of an issue (which had a very important typo before I fixed it) and not looking carefully at its title. While this bug / feature request is not a big, earth-shattering deal, I am generally sympathetic to the idea that operations inside npm should be symmetric. As such, if npm publish reads publishConfig data, then so should npm unpublish. That doesn't mean that I'll have time to get to it anytime soon, though, so if somebody (@jden?) wants to take a whack at putting together a PR, I'd be happy to work with them to land it.

@othiym23 othiym23 reopened this Sep 26, 2014

@dweidenfeld

This comment has been minimized.

Show comment
Hide comment
@dweidenfeld

dweidenfeld Apr 20, 2015

Is there some update on this?

Is there some update on this?

@suarasaur

This comment has been minimized.

Show comment
Hide comment
@suarasaur

suarasaur Apr 20, 2015

I no longer have the multiregistry use case, nor the time to put together this PR, although I am generally in favor of the npm client being multi-registry friendly and being able to control this via package.json.

I no longer have the multiregistry use case, nor the time to put together this PR, although I am generally in favor of the npm client being multi-registry friendly and being able to control this via package.json.

@watilde

This comment has been minimized.

Show comment
Hide comment
@watilde

watilde Apr 20, 2015

Contributor

I just tried to create a patch at #8013.

Contributor

watilde commented Apr 20, 2015

I just tried to create a patch at #8013.

@othiym23

This comment has been minimized.

Show comment
Hide comment
@othiym23

othiym23 Apr 24, 2015

Contributor

@watilde's patch was a good one, and so is landed as 18ce0ec. I still think that for most per-project configuration, .npmrc is a better place to put this configuration, but now npm publish and npm unpublish use the exact same logic to set the configuration from package.json's publishConfig stanza.

Contributor

othiym23 commented Apr 24, 2015

@watilde's patch was a good one, and so is landed as 18ce0ec. I still think that for most per-project configuration, .npmrc is a better place to put this configuration, but now npm publish and npm unpublish use the exact same logic to set the configuration from package.json's publishConfig stanza.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment