Why? -> Warning Cannot include file %1 into executable.

See original GitHub issue
> Warning Cannot include file %1 into executable.
  The file must be distributed with executable as %2.
  node_modules/opn/xdg-open
  path-to-executable/xdg-open
  1. I guess the placeholder %1 should be replaced with the actual string.
  2. Why can it not be included? I want to understand the reason behind it. Packaging my application to a single executable and then be forced to supply additional files kind of destroys the single executable claim.

Is there a way to fix this? On pkg or user level?

Thanks a lot 😃

Related:

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:17
  • Comments:10

github_iconTop GitHub Comments

12reactions
robertsLandocommented, Jul 31, 2018

For this I have create a script in package.json to copy each file that cannot be included in the exec in the executable dir (in my case the exec dir is dist specified in the option --out-path dist):

"scripts": {
    "package": "sudo pkg package.json -t node10-linux-x64 --out-path dist && cp ./node_modules/opn/xdg-open ./dist/xdg-open && cp <add here all others file you need to import>",
  },

Than simply run npm run package and that’s it 😄

4reactions
stuartelliscommented, Mar 19, 2019

I am seeing the same message when building on macOS Mojave, for macOS and Windows targets. Since this is not an error, and outside of the control of the pkg project, perhaps the best option is to add a note to the documentation.

Would the maintainers accept a docs PR for this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Warning Cannot include addon %1 into executable? #935
The command I use is pkg dist/index.js -t node10-linux-x64,node10-macos-x64,node10-win-x64 and then I copied all my .node files from my ...
Read more >
Warning Cannot include file %1 into executable - pkg error
I'm trying to build a notifications solution to update me in case any new jobs posted through Upwork. I built it with NodeJS...
Read more >
pkg
Package your Node.js project into an executable. ... Deploy it as a single file; Put your assets inside the executable to make it...
Read more >
Warning Cannot include directory %1 into executable.怎么 ...
我写了一个node脚本,在用pkg打包的时候,遇到了下面的情况. Warning Cannot include directory %1 into executable. The directory must be ...
Read more >
Why? -> Warning Cannot include file %1 into executable. -
Packaging my application to a single executable and then be forced to supply additional files kind of destroys the single executable claim.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found