prebuild / node-gyp-build

Build tool and bindings loader for node-gyp that supports prebuilds
MIT License
109 stars 37 forks source link

npm workspaces path issues #60

Open prsauer opened 1 year ago

prsauer commented 1 year ago

I'm trying to install a library for an electron app I am writing

In the library they use

const lib = require('node-gyp-build')(__dirname);

to load the module.

This seems correct based on the README here. However, my project uses npm workspaces and this is causing a problem:

__dirname evaluates to myproject/packages/mypackage even though the library is actually installed to myproject/node_modules/library

The end result being an error:

 No native build was found for platform=win32 arch=x64 runtime=node abi=93 uv=1 libc=glibc node=16.18.1

I'm not sure how to proceed -- ultimately I could patch the package to force it to use the correct path but I'm curious if there is a more reasonable path forward for supporting npm workspaces using this tool

ph342 commented 4 months ago

We have the same issue. @prsauer Have you had any luck with this? Thank you!