lsongdev / lsongdev/node-bluetooth

[BUG]: Can't build on windows 11 : missing function arguments

未关闭
#61 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

bug
主要语言
C++
星标
205
派生
56
PR 合并指标
30 天内没有已合并 PR

描述

Description of the bug

Installed with Yarn on electron-vite project on windows 11
Yarn install says node-bluetooth@npm:1.2.6 must be built because it never has been before or the last one failed
then build fails with error :
...\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(128,60): error C2660: 'v8::FunctionTemplate::GetFunction' : function doesn't take 0 arguments

Steps To Reproduce

In fresh electron-vite project :

  • choco install python visualstudio2022-workload-vctools -y
  • yarn add -d electron-rebuild
  • yarn add node-bluetooth bindings
Additional Information

Yarn add result :

node-bluetooth@npm:1.2.6 must be built because it never has been before or the last one failed
node-bluetooth@npm:1.2.6 couldn't be built successfully (exit code 1, logs can be found here: ...\AppData\Local\Temp\xfs-158d74f1\build.log)

build.log :
each of the following errors happen multiple times, with a lot of warnings I didn't paste here

...\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(128,60): error C2660: 'v8::FunctionTemplate::GetFunction' : function doesn't take 0 arguments

...\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(336,30): error C2665: 'v8::String::Utf8Value::Utf8Value' : no overloaded function could convert all the argument types

...\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(416,32): error C2661: 'v8::Object::Set' : no overloaded function takes 2 arguments

...\node_modules\node-bluetooth\src\windows\DeviceINQ.cc(522,9): error C2660: 'v8::Function::Call' : function doesn't take 3 arguments

gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

使用列出的 Yarn 和 Windows 设置,在一个全新的 electron-vite 项目中重现该失败,然后结合 build.log 中的错误检查 src/windows/DeviceINQ.cc。当 node-bluetooth 在 Windows 11 上成功构建且不再出现报告的 V8 API 错误时,工作即告完成。

由索引模型根据 Issue 内容生成。

评估

技术栈
cpp, electron, node.js
领域
build-system, embedded-iot
Issue 类型
缺陷
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
基本清楚
新手友好度
45/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。