Pre-Existing Packages
Restrictions
Currently, it is not possible to change the scope of a pre-existing public or private, scoped or not, package to an Organization.
Specifically, given a private, scoped package @ag_dubs/foo
,
there is currently no way to make that exact package scoped to
the Organization, @ag_org
, i.e. @ag_org/foo
without creating
a new package.
However, Organization members who are either a
that are also:
- an admin member of the package's org, for org-scoped packages
- the user, for user-scoped packages
and, as of npm@3.5.0/npm@2.14.12
:
- the last publisher on a public package
... are able to grant Organization team access to packages that are not scoped within the Organization.
Examples
meow-org
Super Admin, Irina, is also a Team Admin forpizza-org
. Irina can grant themeow-org/cyborgs
team access to thepizza-org/pepperoni
package.puppyco/corgis
Team Admin, Lewis, has a personal private package,@lewis/corgis
. Lewis can grant thepuppyco/corgis
team access to his@lewis/corgis
package.cactus-inc
Super Admin, Corey, was also the last person to publish the public package,bdaypresent
. Corey can grant thecactus-inc/friends
team access to thebdaypresent
package.
(*yup. this is weird. we know.)
Note: It is possible to migrate a User scope to an Organization scope. For more information on that check out the Migrating a Current User Scope to an Org in the Creating an Org documentation.
Granting Team Access to a Package
So, let's say you have a package @ag_dubs/foo
that you would like to
collaborate on within the Organization @ag_org
.
First, ensure that you have the correct permissions. The user must:
- Be a Super Admin or Team Admin in the Organization
- Be an admin of the package,
@ag_dubs/foo
Then, you can grant team access to a package, as though it were scoped to the Organization:
> > npm access grant <read-only|read-write> <org:team> @ag_dubs/foo