Skip to content

[Bug]: Linux 下不支持 fs.watch 的 recursive: true 选项 #115

@arenekosreal

Description

@arenekosreal

重现步骤

在 Linux 下安装 lite_tools 并且从终端启动 QQ,可能需要打开本地表情?
发现带有输出

[轻量工具箱]撤回管理>  新的历史记录实例,目标文件 latestRecallMessage.json 实例状态 读写 切片大小 100
(node:2) UnhandledPromiseRejectionWarning: TypeError [ERR_FEATURE_UNAVAILABLE_ON_PLATFORM]: The feature watch recursively is unavailable on the current platform, which is being used to run Node.js
    at new NodeError (node:internal/errors:405:5)
    at Object.watch (node:fs:2416:11)
    at loadEmoticons (/home/zhanghua/.var/app/com.qq.QQ.Liteloadered/config/LiteLoaderQQNT/plugins/lite_tools_v4/src/main_modules/localEmoticons.js:22:16)
(Use `qq --trace-warnings ...` to show where the warning was created)

原因为 nodejs 18 还不支持 linux 下使用 recursive: true 给 fs.watch
出问题的代码:https://github.com/xiyuesaves/LiteLoaderQQNT-lite_tools/blob/v4/src/main_modules/localEmoticons.js#L24
建议修正:Linux 下检查 nodejs 版本号,目前只有 18.13 这个 LTS 版本及 19 和以后的版本可以支持 recursive: true 参数
参见:nodejs/node#45098

Metadata

Metadata

Assignees

No one assigned

    Labels

    bug某些功能无法正常工作

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions