Skip to content

Binary relocation not working for bindings and node-pre-gyp #75

@rochdev

Description

@rochdev

I tried using both binding and node-pre-gyp include patterns and both are not working even though the documentation states that they should be supported.

The setup I'm trying to get working is main project "foo" with a dependency on "bar" where the native binaries are in "bar".

What I tried:

  • Using bindings in "bar" with the file located at lib/binding/node-v72-darwin-x64/bindings.node.
  • Using bindings in "bar" with the file located at build/Release/bindings.node.
  • Using node-pre-gyp pattern in "bar" with the file located at lib/binding/node-v72-darwin-x64/bindings.node and calling require(`../../../lib/binding/node-v${process.versions.modules}-${process.platform}-${process.arch}/bindings.node`).

Interestingly, for the last case if I call instead require(`../../../lib/binding/node-v72-${os.platform()}-${os.arch()}/bindings.node`) it works properly. It looks like os is supported for dynamic paths but not process? I wonder if the same issue applies to bindings which would explain why it also doesn't work.

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