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

Warning Cannot include file %1 into executable - pkg error #1657

Closed
frodoe7 opened this issue Jun 15, 2022 · 12 comments
Closed

Warning Cannot include file %1 into executable - pkg error #1657

frodoe7 opened this issue Jun 15, 2022 · 12 comments
Labels

Comments

@frodoe7
Copy link

frodoe7 commented Jun 15, 2022

What version of pkg are you using?

5.7.0

What version of Node.js are you using?

16.14.0

What operating system are you using?

macOS

What CPU architecture are you using?

Quad-Core Intel Core i7

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

node16-linux-x64, node16-macos-x64, node16-win-x64

Describe the Bug

Here's the output after running pkg index.js

Targets not specified. Assuming: node16-linux-x64, node16-macos-x64, node16-win-x64

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/node-notifier/vendor/notifu/notifu.exe %2: path-to-executable/notifier/notifu.exe

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/node-notifier/vendor/notifu/notifu64.exe %2: path-to-executable/notifier/notifu64.exe

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/node-notifier/vendor/terminal-notifier.app/Contents/MacOS/terminal-notifier %2: path-to-executable/notifier/terminal-notifier

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/node-notifier/vendor/snoreToast/snoretoast-x64.exe %2: path-to-executable/notifier/snoretoast-x64.exe

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/node-notifier/vendor/snoreToast/snoretoast-x86.exe %2: path-to-executable/notifier/snoretoast-x86.exe

Warning Cannot include file %1 into executable. The file must be distributed with executable as %2. %1: node_modules/open/xdg-open %2: path-to-executable/xdg-open

Looks there's an issue between pkg and node-notifier package https://github.com/mikaelbr/node-notifier

A similar issue mikaelbr/node-notifier#220 (comment)

Anyone have any ideas how to fix that?

Expected Behavior

To bundle the file correctly and show notifications from that package node-notifier

To Reproduce

Build a minimal project with node-notifier
and try to run any notification

will work on the development environment,
but after bundling with pkg, will fire these warnings and won't show any notifications

@Devilsmaul
Copy link

Devilsmaul commented Jun 21, 2022

I got the same error with package "level": "^7.0.0"

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

@Devilsmaul
Copy link

reading the output more carefully i was able to fix this issue.
i had to copy the prebuilds from %1: node_modules/leveldown/prebuilds
into my executable directory in the folder prebuilds

image

@AliSawari
Copy link

I have the same issue, also trying to use node-notifier with pkg
OS: Windows 10 64bit
Node: 16.15.1
Output

The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\notifu\notifu.exe
%2: path-to-executable/notifier/notifu.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\notifu\notifu64.exe
%2: path-to-executable/notifier/notifu64.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\terminal-notifier.app\Contents\MacOS\terminal-notifier
%2: path-to-executable/notifier/terminal-notifier
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x64.exe
%2: path-to-executable/notifier/snoretoast-x64.exe
> Warning Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\node-notifier\vendor\snoreToast\snoretoast-x86.exe
%2: path-to-executable/notifier/snoretoast-x86.exe

apparently #1021. didn't fix this issue

@mazero
Copy link

mazero commented Aug 17, 2022

I have the same error.

Cannot include file %1 into executable.
The file must be distributed with executable as %2.
%1: node_modules\open\xdg-open
%2: path-to-executable/xdg-open

Any ideas ? I try to copy/paste the module in the exectuable folder... but nothing :/

@MariuzM
Copy link

MariuzM commented Aug 30, 2022

For me same issue:

> pkg@5.8.0
> Targets not specified. Assuming:
  node18-linux-arm64, node18-macos-arm64, node18-win-arm64
> Warning Cannot include directory %1 into executable.
  The directory must be distributed with executable as %2.
  %1: ../node_modules/puppeteer/.local-chromium
  %2: path-to-executable/puppeteer
> Warning Failed to make bytecode node18-arm64 for file /snapshot/<PROJECT>/build/app.js
> Warning Failed to make bytecode node18-arm64 for file /snapshot/<PROJECT>/build/app.js
> Warning Failed to make bytecode node18-arm64 for file C:\snapshot\<PROJECT>\build\app.js

@Devilsmaul
Copy link

@MariuzM have you tried to copy
/node_modules/puppeteer/.local-chromium
into
path-to-executable/puppeteer
?

@wlc015f
Copy link

wlc015f commented Dec 8, 2022

i've got same error with sharp, and find no solution

can anyone have the solution? got the same issue with sharp.

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

@rajajwaliya
Copy link

it is resolved. I am using caxa npm.

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

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 9, 2023
@github-actions
Copy link

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

@good1uck
Copy link

image

@good1uck
Copy link

Try above

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

8 participants