cli icon indicating copy to clipboard operation
cli copied to clipboard

Self Hosting 3rd party registries & adding/removing 3rd party registries into npm

Open trymeouteh opened this issue 3 years ago • 8 comments

  • The ability to self host your own npm registries which will require releasing npm to be fully open source and instructions on how to deploy your own npm registry to self host your own package and optionally allow others to host their packages on the 3rd party registry.
  • The ability to add/remove registries in npm. This will require new commands such ad addregistry, removeregistry and listregistry.
  • The ability to download a package from a 3rd party registry. the install command must allow domain names such as npm install example.com:moment or npm install example.com/moment/moment.
  • The ability to have a default registry set and the ability to change the default registry. By default the default registry will be npmjs.com, the official registry but to have the ability to change this with a command such as changedefaultregistry. The user is able to download packages from the default registry without having to put the domain name in front of it, for example if the default registry is npmjs.com, the user can enter npm install bootstrap and not need to enter npm install npmjs.com:bootstrap.
  • The ability to have packages require dependencies from packages on different registries.

Such a feature will allow for decentralisation, private registries and the ability to truly self host your own packages.

trymeouteh avatar Dec 16 '22 17:12 trymeouteh

What is a "repository" in npm? (I think that the term you mean here is "registry"; a repo is something in version control)

You can already self-host an npm registry; Verdaccio is a popular open source one.

npm install --registry=whatever has worked for a very, very long time.

ljharb avatar Dec 16 '22 17:12 ljharb

Verdaccio is a NPM package to allow you to install packages from self hosted repos. I am suggesting having this feature built into NPM.

trymeouteh avatar Dec 16 '22 18:12 trymeouteh

AKayy2020 avatar Dec 16 '22 18:12 AKayy2020

@trymeouteh no, it's an npm registry that hosts packages, like npmjs.com itself.

The feature is already built into npm - you publish packages to it, and install them from it.

ljharb avatar Dec 16 '22 21:12 ljharb

Is there a Verdaccio registry out there that is public that I can try out?

trymeouteh avatar Dec 16 '22 23:12 trymeouteh

I doubt it, but it's open source, you can set it up and host it locally, and try it all you want.

Should this issue be closed?

ljharb avatar Dec 16 '22 23:12 ljharb

Keep this issue open since the purpose of this feature request to allow anyone to host their own NPM registry and allow anyone to add/remove NPM registries within NPM cli without installing any other packages and without using other registries.

trymeouteh avatar Dec 21 '22 02:12 trymeouteh

How would you “add/remove registries” without using other registries?

Other than that part, you already can do that (and have always able to).

ljharb avatar Dec 21 '22 04:12 ljharb