Skip to content
This repository was archived by the owner on Jan 13, 2024. It is now read-only.
This repository was archived by the owner on Jan 13, 2024. It is now read-only.

Warnings when bundling leveldown. #1264

@tegefaulkes

Description

@tegefaulkes

I'm trying to bundle a simple node program that includes some native modules. One of these modules is level witch includes leveldown.

When trying to use pkg to build I receive the following error.

pkg . --targets linux-x64 --no-bytecode --public-packages "*" --output linprog
> [email protected]
> Warning Cannot include directory %1 into executable.
  The directory must be distributed with executable as %2.
  %1: node_modules/leveldown/prebuilds
  %2: path-to-executable/prebuilds
> Warning Cannot include directory %1 into executable.
  The directory must be distributed with executable as %2.
  %1: node_modules/leveldown/prebuilds
  %2: path-to-executable/prebuilds

The built executable works if I include the prebuilds with it.

Now as far as I know, pkg should detect and include these native modules properly now. So I shouldn't need to include these manually. Is there any reason why this isn't working?

When I try to add the files as an asset in the package.json with:

"pkg": {
    "assets": [
      "node_modules/leveldown/**/*",
    ]
  }

I can confirm the files are being added when I check the log with the --debug flag.

The odd thing is, this project also includes utp-native witch seems to be bundled just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions