Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

error C1083: Cannot open include file: 'node_api.h': No such file or directory #1

Closed
marcus-sa opened this issue Jun 11, 2019 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@marcus-sa
Copy link
Member

marcus-sa commented Jun 11, 2019

Some bug regarding node-addon-api since it tries to lookup the wrapper headers in the root project directory instead of inside the src directory.

node_modules/node-addon-api/napi.h includes node_api.h as it was in the same directory as napi.h even though node_api.h is actually located inside src

marcu@LAPTOP-2U4CEF97  ~/Git/venobo/cerberus (master)
$ yarn build
yarn run v1.16.0
$ node build.js
info TOOL Using Visual Studio 16 2019 generator.
info CMD CLEAN
info RUN cmake -E remove_directory "C:\Users\marcu\Git\venobo\cerberus\build"
info CMD CONFIGURE
info RUN cmake "C:\Users\marcu\Git\venobo\cerberus" --no-warn-unused-cli -G"Visual Studio 16 2019" -DCMAKE_JS_VERSION="5.2.0" -DCMAKE_BUILD_TYPE="Release" -DCMAKE_RUNTIME_OU

TPUT_DIRECTORY="C:\Users\marcu\Git\venobo\cerberus\build" -DCMAKE_JS_INC="C:\Users\marcu\.cmake-js\electron-ia64\v5.0.3\include\node" -DCMAKE_JS_SRC="C:/Users/marcu/Git/veno

bo/cerberus/node_modules/cmake-js/lib/cpp/win_delay_load_hook.cc" -DNODE_RUNTIME="electron" -DNODE_RUNTIMEVERSION="5.0.3" -DNODE_ARCH="ia64" -DCMAKE_JS_LIB="C:\Users\marcu\.

cmake-js\electron-ia64\v5.0.3\node.lib" -DCMAKE_SHARED_LINKER_FLAGS="/DELAYLOAD:NODE.EXE"
Not searching for unused variables given on the command line.
-- Selecting Windows SDK version 10.0.17763.0 to target Windows 10.0.17134.
-- The C compiler identification is MSVC 19.21.27702.2
-- The CXX compiler identification is MSVC 19.21.27702.2
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe
-- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2019/BuildTools/VC/Tools/MSVC/14.21.27702/bin/Hostx64/x64/cl.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Configuring done
-- Generating done
-- Build files have been written to: C:/Users/marcu/Git/venobo/cerberus/build
info CMD BUILD
info RUN cmake --build "C:\Users\marcu\Git\venobo\cerberus\build" --config Release
Microsoft (R) Build Engine version 16.1.76+g14b0a930a7 for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

  Checking Build System
  CMake does not need to re-run because C:/Users/marcu/Git/venobo/cerberus/build/CMakeFiles/generate.stamp is up-to-date.
  Building Custom Rule C:/Users/marcu/Git/venobo/cerberus/CMakeLists.txt
  CMake does not need to re-run because C:/Users/marcu/Git/venobo/cerberus/build/CMakeFiles/generate.stamp is up-to-date.
  Cerberus.cpp
  CerberusPlayer.cpp
C:\Users\marcu\Git\venobo\cerberus\node_modules\node-addon-api\napi.h(4,10): error C1083:  Cannot open include file: 'node_api.h': No such file or directory [C:\Users\marcu
\Git\venobo\cerberus\build\Cerberus.vcxproj]
  Generating Code...
C:\Users\marcu\Git\venobo\cerberus\node_modules\node-addon-api\napi.h(4,10): error C1083:  Cannot open include file: 'node_api.h': No such file or directory [C:\Users\marcu
\Git\venobo\cerberus\build\Cerberus.vcxproj]
ERR! OMG Process terminated: 1
Unhandled rejection Error: Process terminated: 1
    at ChildProcess.<anonymous> (C:\Users\marcu\Git\venobo\cerberus\node_modules\cmake-js\lib\es6\processHelpers.js:29:32)
    at ChildProcess.emit (events.js:196:13)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:257:12)

Done in 26.27s.

The following documentation is outdated:
https://github.com/cmake-js/cmake-js#n-api-and-node-addon-api

Related:

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant