Skip to content

Embedding: Distribute official libnode.so/dll/dylib bins #58031

Description

@alshdavid

What is the problem this feature will solve?

Currently Node is distributed officially as an executable binary here: https://nodejs.org/dist/v22.15.0/.

For applications that intend to embed libnode, embedders must manually compile and distribute libnode.

There are projects like https://github.com/metacall/libnode that distribute prebuilt copies of libnode however it would be amazing if there was a reliable official source to fetch libnode as it would help with distributing applications that depend on it.

What is the feature you are proposing to solve the problem?

Distribute prebuilt libnode binaries from the Nodejs website. For example:

https://nodejs.org/dist/v22.15.0/libnode-v22.15.0-linux-x64.tar.xz

With a reliable url to fetch libnode, embedders could package/distribute libnode along with their applications or fetch libnode dynamically on the first run of their application.

What alternatives have you considered?

Compiling libnode myself or using unofficial prebuilt packages

Activity

  1. RaisinTen commented on Apr 26, 2025

    @RaisinTen
    Member

    This is a duplicate of #52289, so I'll close this

  2. alshdavid commented on Apr 28, 2025

    @alshdavid
    Author

    Hi @RaisinTen, the ticket you referenced is about improving the libnode API to make it easier to embed (e.g. offer a C API) - however it still requires compiling libnode manually.

    This ticket is about providing official prebuilt binaries for libnode - which can be done with the existing C++ API.

    Correct me if I am wrong but I believe they are different requests?

  3. RaisinTen commented on Apr 28, 2025

    @RaisinTen
    Member

    Hey @alshdavid, the other issue proposes this as the feature for solving the problem:

    It would be amazing if Node.js released a libnode library that exported Node.js capabilities and enabled napi access to the host context.

    That's the same as distributing prebuilt official libnode binaries, so it makes more sense to track the work for including libnode binaries in the official Node.js releases on that issue.

    For a C API, there is this WIP PR #54660. Looks like you're already coordinating with Vladimir on your C entrypoint PR #57846.

  4. alshdavid commented on May 4, 2025

    @alshdavid
    Author

    Hey @RaisinTen, just a quick one on this subject. I have this GitHub workflow that I run every time Nodejs releases a new version which generates prebuilt binaries for libnode (I assume the final state would be more complex given the platform support surface of Nodejs).

    I wanted to raise a PR to start working on adding prebuilt libnode binaries to the Nodejs repo for consideration by the team but it doesn't look like Nodejs is using Github actions to generate binaries. Any chance you could point me at the CI code so I can work on those changes? 🙏

    Thanks!

  5. RaisinTen commented on May 4, 2025

    @RaisinTen
    Member

    I think @mhdawson might be able to point you in the right direction.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature requestIssues requesting new Node.js features.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions