You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
C1083: Cannot open include file: 'napi.h': No such file or directory #183
I get an error about not being able to find napi.h on Windows.
This only occurs when I use "include_dirs": ["<!@(node -p \"require('node-addon-api').include_dir\")"] versus "include_dirs": ["<!@(node -p \"require('node-addon-api').include\")"] (I was trying to use the former because in the index.js file it says the latter is deprecated.
The only difference I noticed is that inside the in the index.js file in the repo we have the include path in escaped quotes.
I've tried doing this as an experiment in another bindings repo and I found if I add the quotes to the include path it works versus without.
include: `"${__dirname}"`
versus
include: `${__dirname}`
(The second one gives the error)
[Edit]: I just tried this on Linux (using WSL) and seems like I have the inverse problem...
fatal error: napi.h: No such file or directory
4 | #include "napi.h"
| ^~~~~~~~
compilation terminated.
Activity
SurienDG commentedon May 10, 2021
So I found that if we simply change line 3 of
index.jstothen it works on both platforms. Can we have this change made?
mhdawson commentedon May 14, 2021
@SurienDG can you submit a PR for that change?
SurienDG commentedon May 15, 2021
@mhdawson Sure thing 😀. I added one here: nodejs/node-addon-api#1001
mhdawson commentedon May 17, 2021
@SurienDG thanks. For some reason the PR seems to cause failures across platforms, can you take a look.