koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.53k stars 246 forks source link

Bug: yarn pub 无法正常上传包 #1376

Closed axiangcoding closed 8 months ago

axiangcoding commented 8 months ago

Describe the bug

按照文档描述进行包上传,但是无法正常上传

Steps to reproduce

先根据 https://koishi.chat/zh-CN/guide/develop/setup.html#%E6%B3%A8%E5%86%8C-npm 执行了

npm login --registry=https://registry.npmjs.org

再根据 https://koishi.chat/zh-CN/guide/develop/publish.html#%E5%8F%91%E5%B8%83%E6%8F%92%E4%BB%B6-1 执行了

yarn pub mypackage --debug

结果提示

➤ YN0000: package.json
➤ YN0000: readme.md
➤ YN0033: No authentication configured for request
➤ YN0000: Failed with errors in 0s 81ms
✖ Published 0 packages, 1 failed.

尝试按照文档提示指定repo,形如

yarn pub mypackage --registry=https://registry.npmjs.org --debug

结果提示

Unknown Syntax Error: Unsupported option name ("--registry").

$ yarn npm publish [--access #0] [--tag #0] [--tolerate-republish] [--otp #0]
✖ Published 0 packages, 1 failed.

Expected behavior

按照文档描述,可以完成包上传的动作

Screenshots

No response

Versions

Additional context

No response

shigma commented 8 months ago

这是混用不同的包管理器导致的。

如果你使用 yarn pub,那么应该先 yarn npm login 而非 npm login。

axiangcoding commented 8 months ago

这是混用不同的包管理器导致的。

如果你使用 yarn pub,那么应该先 yarn npm login 而非 npm login。

谢谢,我怀疑是这个原因,我再看下。感谢回复