#1139670 node-addon-api: Bad path resolution when symlinked into node_modules

#1139670#5
Date:
2026-06-11 00:36:19 UTC
From:
To:
While building in sbuild node-sharp (to be uploaded),
I saw that error:

FileNotFoundError: [Errno 2] No such file or directory: './build/../../../../usr/share/nodejs/node-addon-api/node_addon_api_maybe.target.mk'

It's like https://github.com/prebuild/prebuildify-cross/issues/23

In some cases it doesn't fail. In others it does.

#1139670#10
Date:
2026-06-19 14:31:38 UTC
From:
To:
This bug appears when using the deprecated way of configuring binding.gyp.

To avoid that, one has to remove the require in dependencies like so:
--- a/src/binding.gyp
+++ b/src/binding.gyp
@@ -91,7 +91,6 @@
       'NODE_API_SWALLOW_UNTHROWABLE_EXCEPTIONS'
     ],
     'dependencies': [
-      '<!(node -p "require(\'node-addon-api\').gyp")',
       'libvips-cpp-<(vips_version)'
     ],
     'variables': {


Only the include_dir configuration is needed.

Jérémy