Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node22-linux-x64 binary is exiting with status 4 when built on MacOs (M2) #137

Open
michaelwittig opened this issue Feb 20, 2025 · 1 comment

Comments

@michaelwittig
Copy link

michaelwittig commented Feb 20, 2025

What version of pkg are you using?

6.3.1

What version of Node.js are you using?

v22.14.0

What operating system are you using?

macOS

What CPU architecture are you using?

Apple M2

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

node22-linux-x64

Describe the Bug

On my Apple (M2) laptop:

npx pkg --targets node22-linux-x64 --output main --debug main.js

I don't see anything unusual in the debug output.

On the Linux server:

DEBUG_PKG=2 ./main

output:

[...]
fs.existsSync [ '/snapshot/src/main.js' ]
fs.statSync [ '/snapshot/src/main.js' ]
fs.readSync []
fs.realpathSync [ '/snapshot/src/main.js' ]
fs.readFileSync [ '/snapshot/src/main.js', 'utf8' ]
fs.readSync []
echo $?

output:

4

The binary works when using the --public option for "building":

npx pkg --targets node22-linux-x64 --output main --debug --public main.js

Expected Behavior

The created binary should work.

To Reproduce

https://github.com/michaelwittig/pkgbug

@robertsLando
Copy link
Member

@michaelwittig is this happening only with nodejs 22?

cc @faulpeltz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants