Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Login to npm with multiple scopes

Tags:

node.js

npm

npm allows to assign a scope to a registry at login like this:

npm login --scope=@my-company-name --registry=http://your-server-address:8080

Is it also possible to assign multiple scopes at a particular login?

Because docs say:

Scopes have a many-to-one relationship with registries: one registry can host multiple scopes, but a scope only ever points to one registry.

like image 648
Alexander Zeitler Avatar asked Jul 05 '16 19:07

Alexander Zeitler


1 Answers

The solution is to login multiple times using different scopes:

npm login --scope=@scope1 --registry=http://your-server-address:8080
npm login --scope=@scope2 --registry=http://your-server-address:8080

After this you can use packages scoped with @scope1 and @scope2.

like image 78
Alexander Zeitler Avatar answered Oct 14 '22 03:10

Alexander Zeitler