koishi插件发布时报错

PS F:\koiship\koishi-app> npm run build nqblacklist

> koishi-app@0.0.0 build
> yakumo build nqblacklist

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
esbuild: external\nqblacklist\src\index.ts -> external\nqblacklist\lib\index.js
PS F:\koiship\koishi-app> npm run pub nqblacklist --verbose
npm verbose cli C:\Program Files\nodejs\node.exe C:\Users\Lenovo\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm info using npm@11.0.0
npm info using node@v20.17.0
npm verbose title npm run pub nqblacklist
npm verbose argv "run" "pub" "nqblacklist" "--loglevel" "verbose"
npm verbose logfile logs-max:10 dir:C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2024-12-25T03_39_36_078Z-
npm verbose logfile C:\Users\Lenovo\AppData\Local\npm-cache\_logs\2024-12-25T03_39_36_078Z-debug-0.log

> koishi-app@0.0.0 pub
> yakumo publish nqblacklist

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
✖ Published 0 packages, 1 failed.
npm verbose cwd F:\koiship\koishi-app
npm verbose os Windows_NT 10.0.22631
npm verbose node v20.17.0
npm verbose npm  v11.0.0
npm verbose exit 0
npm info ok
PS F:\koiship\koishi-app>

源代码已上传至github: wq5794250/nqblacklist: NQ 旗下的云黑插件,用于查询 QQ 号是否在云端黑名单中,并提供定时推送功能,帮助管理员及时了解群内成员的信用状况。

dev状态下可正常使用,但是无法发布

2 个赞
npm login --registry=https://registry.npmjs.org

npm run build
npm run pub -- --registry https://registry.npmjs.org
2 个赞
PS F:\koiship\koishi-app> npm login --registry=https://registry.npmjs.org
npm notice Log in on https://registry.npmjs.org/
Login at:
https://www.npmjs.com/login?next=/login/cli/0cda3285-14cc-43af-9b2a-c5d85150b843
Press ENTER to open in the browser...

Logged in on https://registry.npmjs.org/.
PS F:\koiship\koishi-app> npm run build

> koishi-app@0.0.0 build
> yakumo build

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
esbuild: external\nqblacklist\src\index.ts -> external\nqblacklist\lib\index.js

PS F:\koiship\koishi-app> npm run pub nqblacklist --registry https://registry.npmjs.org

> koishi-app@0.0.0 pub
> yakumo publish nqblacklist

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
✖ Published 0 packages, 1 failed.

还是一样无法发布

2 个赞

哥哥仔细看,你跟我上面输入的命令不一样喔

你的输入:

npm run pub nqblacklist --registry https://registry.npmjs.org

示例输入:

npm run pub -- --registry https://registry.npmjs.org

不改任何符号,直接复制粘贴上去试一下吧

2 个赞
PS F:\koiship\koishi-app> npm run pub -- --registry https://registry.npmjs.org

> koishi-app@0.0.0 pub
> yakumo publish --registry https://registry.npmjs.org

The CJS build of Vite's Node API is deprecated. See https://vite.dev/guide/troubleshooting.html#vite-cjs-node-api-deprecated for more details.
✔ Loading workspaces (1/1)
✖ Published 0 packages, 1 failed.

看起来有戏!!!但是还是无法上传诶

1 个赞

加个 --debug 看看

1 个赞

可以直接打包完后在 external/你的插件 文件夹下执行 npm publish 发布
我之前也是按照文档使用官方提供的 yakumo 还是上传不了