Can't build: `Cannot open include file: 'stddef.h': No such file or directory`
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 35/100
- Issue 类型
- 缺陷
- 描述清晰度
- 需要澄清
- 活跃度
- 停滞
- 技术栈
- nodejs, python
调研方向
使用 README 中显示的 Node.js、Python 和 node-gyp 版本重现 Windows 构建。检查与 src/driver.cpp 和 js_native_api.h 相关的 binding.gyp 以及生成的 build/binding.sln。完成标准是原生 addon 构建时不再出现缺少 stddef.h 的错误。
由索引模型根据 Issue 内容生成。
描述
I installed node-gyp per README and it looks like all paths are correct, yet this header file can't be opened.
gyp info it worked if it ends with ok
gyp info using node-gyp@12.1.0
gyp info using node@22.20.0 | win32 | x64
gyp info find Python using Python version 3.14.0 found at "C:\Python314\python.exe"
gyp info find VS using VS2022 (17.14.36603.0) found at:
gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools"
gyp info find VS run with --verbose for detailed information
gyp info spawn C:\Python314\python.exe
gyp info spawn args [
gyp info spawn args 'C:\\Users\\User\\AppData\\Local\\npm-cache\\_npx\\c463d28440264a05\\node_modules\\node-gyp\\gyp\\gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'msvs',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\User\\dev\\serenade\\client\\node_modules\\serenade-driver\\build\\config.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\User\\AppData\\Local\\npm-cache\\_npx\\c463d28440264a05\\node_modules\\node-gyp\\addon.gypi',
gyp info spawn args '-I',
gyp info spawn args 'C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\22.20.0\\include\\node\\common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=C:\\Users\\User\\AppData\\Local\\node-gyp\\Cache\\22.20.0',
gyp info spawn args '-Dnode_gyp_dir=C:\\Users\\User\\AppData\\Local\\npm-cache\\_npx\\c463d28440264a05\\node_modules\\node-gyp',
gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\User\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\22.20.0\\\\<(target_arch)\\\\node.lib',
gyp info spawn args '-Dmodule_root_dir=C:\\Users\\User\\dev\\serenade\\client\\node_modules\\serenade-driver',
gyp info spawn args '-Dnode_engine=v8',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'C:\\Users\\User\\dev\\serenade\\client\\node_modules\\serenade-driver\\build',
gyp info spawn args '-Goutput_dir=.'
gyp info spawn args ]
gyp info spawn C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe
gyp info spawn args [
gyp info spawn args 'build/binding.sln',
gyp info spawn args '/clp:Verbosity=minimal',
gyp info spawn args '/nologo',
gyp info spawn args '/nodeReuse:false',
gyp info spawn args '/p:Configuration=Release;Platform=x64'
gyp info spawn args ]
driver.cpp
C:\Users\User\AppData\Local\node-gyp\Cache\22.20.0\include\node\js_native_api.h(6,10): error C1083: Cannot open include file: 'stddef.h': No such file or directory [C:\Users\User\dev\serenade\client\node_modules\serenade-driver\build\
serenade-driver.vcxproj]
(compiling source file '../src/driver.cpp')
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\Microsoft Visual Studio\2022\BuildTools\MSBuild\Current\Bin\MSBuild.exe` failed with exit code: 1
gyp ERR! stack at ChildProcess.<anonymous> (C:\Users\User\AppData\Local\npm-cache\_npx\c463d28440264a05\node_modules\node-gyp\lib\build.js:219:23)
gyp ERR! stack at ChildProcess.emit (node:events:519:28)
gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:293:12)
gyp ERR! System Windows_NT 10.0.26200
gyp ERR! command "C:\\nvm4w\\nodejs\\node.exe" "C:\\Users\\User\\AppData\\Local\\npm-cache\\_npx\\c463d28440264a05\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\Users\User\dev\serenade\client\node_modules\serenade-driver
gyp ERR! node -v v22.20.0
gyp ERR! node-gyp -v v12.1.0
gyp ERR! not ok
But it does exist: C:\Program Files (x86)\Windows Kits\10\Include\10.0.26100.0\ucrt\stddef.h
- 主要语言
- Python
- 星标
- 10.7k
- 派生
- 1.9k
- 平均合并
- 1 天 4 小时
- 30 天内合并 PR
- 5
贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
nodejs/node-gyp 的其他 Issue
-
dependencies github_actions
难度 2/5 1-3 小时 新手友好度 68/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
难度 4/5 3-5 天 新手友好度 48/100
-
MSYS2
难度 4/5 3-5 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 48/100
相似的 Issue
-
agent-ready documentation needs-triage
难度 1/5 1-3 小时 新手友好度 88/100
-
documentation
难度 1/5 1 小时以内 新手友好度 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" 未关闭
难度 1/5 1 小时以内 新手友好度 92/100
-
instance instance add
难度 1/5 1 小时以内 新手友好度 72/100
searxng/searx-instances#939 · 1 条评论 ·
-
area-deployment area-integrations triage:bot-seen
难度 2/5 半天 新手友好度 86/100