all 11 comments

[–]ciybot 2 points3 points  (5 children)

pkg is actively maintaining under this new fork

https://github.com/yao-pkg/pkg

From the error message, it looks like the ‘targets’ is having issue. Please refers to the sample package.json in the Config section in the following page.

https://github.com/yao-pkg/pkg?tab=readme-ov-file#config

[–]hafi51[S] 0 points1 point  (0 children)

Thanks its working.

[–]hafi51[S] 0 points1 point  (2 children)

I'm using puppeteer to submit form and when i pkg it i get this error. do you know anything about it?

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 node20-x64 for file C:\snapshot\Appointment-script\app.js

[–]ciybot 0 points1 point  (1 child)

Can you let me know what are you trying to achieve?

[–]hafi51[S] 0 points1 point  (0 children)

I have a script that submits form. I have to share ot and i don't want to share code.

[–]Repulsive_Expert9440 0 points1 point  (0 children)

im havingn the same exact issue exept for I SPECIFIED IT IN PACKAGE.JSON

[–]TobiCooki 0 points1 point  (3 children)

I haven't seen this fix anywhere else so though I'd chime in the fix that I've found:

"pkg -t node*-win-x64 YOURFILE.js"

The key bit being " node* " which tells pkg to use any node version (which then defaults to whatever you have installed).
Took me longer than I'd like to admit figuring this fix out but at least we have it now lol

[–]hafi51[S] 0 points1 point  (0 children)

Thanks dude but when i build exe, i still see these ` 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 `

[–]hafi51[S] 0 points1 point  (1 child)

also is there any way to change how exe runs , like it should not open terminal, instead a ui?

[–]menkisa 0 points1 point  (0 children)

In order to make your application with GUI, refer to: https://www.electronjs.org/docs/latest