Skip to content

npm workspaces path issues #60

@prsauer

Description

@prsauer

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions