创建和发布私有包
See Details
目录
要与一组有限的用户或团队共享你的代码,你可以将私有用户范围或组织范围的包发布到 npm 注册表。
¥To share your code with a limited set of users or teams, you can publish private user-scoped or organization-scoped packages to the npm registry.
有关范围和私有包的更多信息,请参阅“关于范围”和“关于私有包”。
¥For more information on scopes and private packages, see "About scopes" and "About private packages".
注意:在你可以发布私有用户范围的 npm 包之前,你必须 注册 为付费 npm 用户账户。
¥Note: Before you can publish private user-scoped npm packages, you must sign up for a paid npm user account.
此外,要发布私有组织范围的包,你必须先 创建一个 npm 用户账户,然后再 创建付费 npm 组织。
¥Additionally, to publish private organization-scoped packages, you must create an npm user account, then create a paid npm organization.
创建私有包
¥Creating a private package
-
如果你使用 npmrc 去 管理多个注册表上的账户,请在命令行上切换到相应的配置文件:
¥If you are using npmrc to manage accounts on multiple registries, on the command line, switch to the appropriate profile:
npmrc <profile-name>
-
在命令行上,为你的包创建一个目录:
¥On the command line, create a directory for your package:
mkdir my-test-package