npm 包的范围、访问级别和可见性

npm 包的可见性取决于包所在的范围(命名空间),以及为包设置的访问级别(私有或公共)。

🌐 Visibility of npm packages depends on the scope (namespace) in which the package is contained, and the access level (private or public) set for the package.

注意: 要创建组织范围的软件包,你必须先创建一个组织。有关详细信息,请参阅“创建组织”。

npm 包访问矩阵

🌐 npm Package Access Matrix

ScopeAccess levelCan view and downloadCan write (publish)
OrgPrivateMembers of a team in the organization with read access to the packageMembers of a team in the organization with read and write access to the package
OrgPublicEveryoneMembers of a team in the organization with read and write access to the package
UserPrivateThe package owner and users who have been granted read access to the packageThe package owner and users who have been granted read and write access to the package
UserPublicEveryoneThe package owner and users who have been granted read and write access to the package
UnscopedPublicEveryoneThe package owner and users who have been granted read and write access to the package

注意: 只有用户账户可以创建和管理无范围的包。组织只能管理有范围的包。