Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

3.0.0-alpha.15 发布npm包受阻 #1548

Closed
guoguolong opened this issue Jan 14, 2020 · 1 comment
Closed

3.0.0-alpha.15 发布npm包受阻 #1548

guoguolong opened this issue Jan 14, 2020 · 1 comment

Comments

@guoguolong
Copy link

guoguolong commented Jan 14, 2020

最近我在使用 3.0.0-alpha.15 搭建 npm私服,遇到一个问题:

npm login时用 admin用户可以顺利地发布 npm 包 (名字为 @cnpmtest/taigu)。
现在我想添加一个新的用户如allen,使用allen这个用户名发布这个包(@cnpmtest/taigu)。命令行进入 @cnpmtest/taigu 所在的目录执行:

npm adduser allen
npm owner add allen
操作提示成功,执行 npm owner ls返回
admin admin@cnpmjs.org
allen allen@gmail.com

但是当我以allen身份登录之后,执行pub命令,依然不能发布taigu这个包。提示:

npm ERR! code E403
npm ERR! 403 403 Forbidden - PUT http://localhost:7001/@cnpmtest%2taigu - no_perms
npm ERR! 403 In most cases, you or one of your dependencies are requesting
npm ERR! 403 a package version that is forbidden by your security policy.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/allen/.npm/_logs/2020-01-14T10_49_19_948Z-debug.log

实在不懂默认auth的规则,这个到底是什么原因呢,请各位指教

@guoguolong
Copy link
Author

解决了,按照官方how to deploy写的配置文件:enablePrivate: true,此处应修改为: enablePrivate: false,否则非admin用户无法发布

@fengmk2 fengmk2 closed this as completed Mar 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants