rfcs icon indicating copy to clipboard operation
rfcs copied to clipboard

[RRFC] --registry=default or --default-registry support

Open hemanth opened this issue 4 years ago • 4 comments

Motivation

At times for most of the CLI commands that provide support for --registry we would override the proxy with providing the default npm registry URL, rather this would be simpler if we were to have --registry=default option that would set it or use the default npm reg.

Example

npm install --registry=https://registry.npmjs.org/ 

# isn't of ^ we can use 

npm install --registry=default

# or 

npm install --default-registry
npm config set registry https://registry.npmjs.org/

# isn't of ^ we can use 

npm config set registry default

How

Current Behaviour

There is not options other than specifying the URL

Desired Behaviour

Support for --registry=default

References

  • n/a

hemanth avatar May 10 '21 22:05 hemanth

This realistically would end up needing to be a separate config item telling config which values to revert back to their defaults, since --registry is already a string so we can't just say "these values can't be set to this config item"

wraithgar avatar Jun 08 '21 14:06 wraithgar

Or we always default to https://registry.npmjs.org/ ?

hemanth avatar Jun 11 '21 17:06 hemanth

It already is the default. I believe if there were a way to delete a config entry this would functionally do the same thing?

wraithgar avatar Jun 11 '21 18:06 wraithgar

But that may not work because you really would want to be able to do that on the cli. What this really does need is a new config item that says "These config items should be set to their default"

i.e.

npm install --use-default=registry

wraithgar avatar Jun 11 '21 18:06 wraithgar