Skip to content

Can't build: Cannot open include file: 'stddef.h': No such file or directory #3244

Open

Description

@s-h-a-d-o-w

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

Activity

  1. changed the title [-]Can't build: `Cannot open inclu de file: 'stddef.h': No such file or directory`[/-] [+]Can't build: `Cannot open include file: 'stddef.h': No such file or directory`[/+] on Nov 15, 2025
  2. s-h-a-d-o-w commented on Nov 15, 2025

    @s-h-a-d-o-w
    Author

    Yes, I've searched the issues before posting, couldn't find anything useful.

    E.g.:
    #3089 (comment)
    I know Python isn't the problem. What module it is can be seen up there, it's serenade-driver: https://github.com/serenadeai/driver

    #1411 (comment)
    No resolution of the problem.

  3. s-h-a-d-o-w commented on Nov 15, 2025

    @s-h-a-d-o-w
    Author

    The only relevant thing I can see there is: "Search for header file or other pre-requisite that's missing, that may provide a clue where it's supposed to come from (e.g. Windows SDK not installed, OpenSSL, etc.)"

    Did that, that's why I posted the path to the .h file in my OP.

    I also tried running this in a developer prompt, looking at the INCLUDE paths there that definitely contain the directory needed. Same error.

  4. cclauss commented on Nov 15, 2025

    @cclauss
    Contributor

    Install Visual C++ Build Environment: For Visual Studio 2019 or later.

    Should install that file.

  5. s-h-a-d-o-w commented on Nov 15, 2025

    @s-h-a-d-o-w
    Author

    As mentioned, I already had that file. But I tried it anyway, in case there's some other issue with locating it.
    Installing it like this actually worked! Thanks for nudging me to give it a shot anyway.

    I would argue that this means that the installation of visualstudio2022-workload-vctools through Chocolatey should either be removed from the README or maybe mentioned as a secondary option with a warning. Instead of being the primary recommended way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions