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.

Not working with sharp again "Cannot include directory %1 into executable." #1918

@rightaway

Description

@rightaway

What version of pkg are you using?

5.7.0

What version of Node.js are you using?

16.15.0

What operating system are you using?

linux

What CPU architecture are you using?

amd64

What Node versions, OSs and CPU architectures are you building for?

node16-linux-64

Describe the Bug

When I run pkg there are warnings

> [email protected]
compression:  GZip
> Warning Cannot include directory %1 into executable.
  The directory must be distributed with executable as %2.
  %1: node_modules/sharp/build/Release
  %2: path-to-executable/sharp/build/Release
> Warning Cannot include directory %1 into executable.
  The directory must be distributed with executable as %2.
  %1: node_modules/sharp/vendor/lib
  %2: path-to-executable/sharp/vendor/lib

To Reproduce

Try running pkg with sharp as a dependency. You can add these to package.json which I thought would fix it but it didn't.

"assets": [
  "node_modules/sharp/build/Release",
  "node_modules/sharp/vendor/lib"
]
"assets": [
  "node_modules/sharp/build/Release/sharp-linux-x64.node"
]

According to #1075 sharp should be working but it's not.

#229 is a similar issue but like many issues in this vercel pkg repository it got closed automatically even though it's still not working.

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