I'm trying to create a native addon for Node.js and when I include
#include <napi.h>
The Intelli Sense of VS Code says that it cannot detect where node_api.h
is located (it's included by napi.h
).
node-gyp build
works well and it compiles. But I do not understand where is that header in the system and where node-gyp
gets it from? I need to add the path to the Intelli Sense options and to better understand the process of building in general.
I'm playing with this code example.
I have run a full search on disk C (I'm on Windows 10), and found out that the header file node_api.h
is located in
C:\Users\<UserName>\AppData\Local\node-gyp\Cache\<NodeVersion>\include\node
as well as other headers like v8.h
.
If you delete that folder, node-gyp build
no longer works. node-gyp configure
downloads all headers again and restores the above mentioned folder.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With