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

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

Closed
rightaway opened this issue Dec 16, 2022 · 3 comments
Closed
Labels

Comments

@rightaway
Copy link

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.

@Danzo7
Copy link

Danzo7 commented Dec 29, 2022

Same issue here, did u manage to fix it?
Edit:
I was able to fix this by adding "node_modules/sharp/**" . It still shows the same warning at build but it worked, Kinda sad that it added +50mb to the build but what can I say.

@github-actions
Copy link

This issue is stale because it has been open 90 days with no activity. Remove the stale label or comment or this will be closed in 5 days. To ignore this issue entirely you can add the no-stale label

@github-actions github-actions bot added the Stale label Mar 30, 2023
@github-actions
Copy link

github-actions bot commented Apr 5, 2023

This issue is now closed due to inactivity, you can of course reopen or reference this issue if you see fit.

@github-actions github-actions bot closed this as completed Apr 5, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants