forked from vercel/pkg
-
-
Notifications
You must be signed in to change notification settings - Fork 57
Open
Description
What version of pkg are you using?
6.9.0
What version of Node.js are you using?
20.19.5, 22.20.0, 24.10.0
What operating system are you using?
macOS 15
What CPU architecture are you using?
arm64
What Node versions, OSs and CPU architectures are you building for?
linux-x64,win-x64,macos-arm64
Describe the Bug
When I build a macOS binary on Ubuntu using pkg, the build succeeds without any errors.
However, the resulting executable doesn’t run the packaged app — instead, it starts a plain Node.js process.
I checked #87 and #181, but couldn’t determine whether they are related.
Expected Behavior
The packaged application should start normally, as it does when built natively on macOS.
To Reproduce
# Step 1. Build executables for macOS on a Linux x64 machine
echo 'console.log("Hello, World!");' > index.js
npx @yao-pkg/pkg@6.9.0 --sea index.js -t macos-x64,macos-arm64
# => executables are generated (index-arm64, index-x64)
# Step 2. Copy executables (index-arm64, index-x64) to a macOS machine
# Step 3. Run executables on a macOS machine (I checked on Apple M1)
./index-arm64
# => Node.js REPL starts
# Welcome to Node.js v22.20.0.
# Type ".help" for more information.
# >
# Error: Could not open history file.
# REPL session history will not be persisted.
# >
./index-x64
# => Node.js REPL starts
# Welcome to Node.js v22.20.0.
# Type ".help" for more information.
# >
# Error: Could not open history file.
# REPL session history will not be persisted.
# >Repro Repo
A minimal reproduction using CI is available here:
https://github.com/tasshi-playground/repro-pkg-cross-platform-issue
Build on linux
- Workflow: https://github.com/tasshi-playground/repro-pkg-cross-platform-issue/actions/runs/18583008230/workflow
- Result: https://github.com/tasshi-playground/repro-pkg-cross-platform-issue/actions/runs/18583008230/job/52981503779
Built on macos
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels