nodejs / help

:sparkles: Need help with Node.js? File an Issue here. :rocket:
1.44k stars 276 forks source link

Can't read and write to target executable #4416

Open Drjacky opened 3 weeks ago

Drjacky commented 3 weeks ago

Node.js Version

v21.6.2

NPM Version

10.8.1

Operating System

macOS

Subsystem

Other

Description

I followed these steps https://nodejs.org/api/single-executable-applications.html When I run

npx postject hello NODE_SEA_BLOB sea-prep.blob \
    --sentinel-fuse NODE_SEA_FUSE_fce680ab2cc467b6e072b8b5df1996b2 \
    --macho-segment-name NODE_SEA

I get:

Start injection of NODE_SEA_BLOB in hello... Error: Can't read and write to target executable

Related to: https://github.com/nodejs/help/issues/4313#issuecomment-2154980165

Minimal Reproduction

No response

Output

No response

Before You Submit

sudospaes commented 3 weeks ago

First, check that the hello binary file is available and your blob name is exactly sea-prep.blob. :) I hope I helped you

Drjacky commented 3 weeks ago

First, check that the hello binary file is available and your blob name is exactly sea-prep.blob. :) I hope I helped you

Yup, the binary is there. the sea-prep.blob is there.

RedYetiDev commented 3 weeks ago

Make sure you are calling the binary from a user account that has access to write it and the directory it's in (but I'm not a SEA expert)

Drjacky commented 3 weeks ago

Make sure you are calling the binary from a user account that has access to write it and the directory it's in (but I'm not a SEA expert)

Okay, running by sudo solved the initial issue but, the generated bin is not runnable on macOS:

[1] 8752 killed hello --version

RedYetiDev commented 4 days ago

@nodejs/single-executable PTAL, thanks!