pkg icon indicating copy to clipboard operation
pkg copied to clipboard

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

Open rightaway opened this issue 3 years ago • 0 comments

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 https://github.com/vercel/pkg/issues/1075 sharp should be working but it's not.

https://github.com/vercel/pkg/issues/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.

rightaway avatar Jul 11 '22 15:07 rightaway