Skip to content

"node.h" file not found error with Electron #45

@SpaceK33z

Description

@SpaceK33z

I followed cmake-js's readme to add compatibility with Electron, but get the following error:

Scanning dependencies of target ref
[ 58%] Building CXX object deps/ref-cmake/CMakeFiles/ref.dir/__/ref/src/binding.cc.o
/Users/kees/dev/cmake-js-electron-error/node_modules/fastcall/deps/ref/src/binding.cc:5:10: fatal error: 'node.h' file not found
#include "node.h"
         ^~~~~~~~
1 error generated.
gmake[2]: *** [deps/ref-cmake/CMakeFiles/ref.dir/build.make:63: deps/ref-cmake/CMakeFiles/ref.dir/__/ref/src/binding.cc.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:1252: deps/ref-cmake/CMakeFiles/ref.dir/all] Error 2
gmake: *** [Makefile:152: all] Error 2
ERR! OMG Process terminated: 2

It seems Node header files are missing, but I don't know how to add this?

It's very easy to reproduce, just make a package.json file with the following contents:

{
  "name": "cmake-js-electron-error",
  "dependencies": {
    "electron": "^4.0.4",
    "fastcall": "^0.2.6"
  },
  "cmake-js": {
    "runtime": "electron",
    "runtimeVersion": "4.0.4"
  }
}

Previously reported in cmake-js/cmake-js#157

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions