help icon indicating copy to clipboard operation
help copied to clipboard

Can't read and write to target executable

Open Drjacky opened this issue 1 year ago • 6 comments

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

  • [X] I have looked for issues that already exist before submitting this
  • [X] My issue follows the guidelines in the README file, and follows the 'How to ask a good question' guide at https://stackoverflow.com/help/how-to-ask

Drjacky avatar Jun 07 '24 16:06 Drjacky

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

sudospaes avatar Jun 09 '24 09:06 sudospaes

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.

Drjacky avatar Jun 09 '24 10:06 Drjacky

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)

avivkeller avatar Jun 09 '24 12:06 avivkeller

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

Drjacky avatar Jun 09 '24 14:06 Drjacky

@nodejs/single-executable PTAL, thanks!

avivkeller avatar Jun 28 '24 00:06 avivkeller

The executable file might not have the necessary permissions. Check for permissions.

KalharaBatangala avatar Aug 20 '24 05:08 KalharaBatangala

Need to run

chmod 755 hello

image

tonidy avatar Dec 01 '24 05:12 tonidy

Per the comments above

avivkeller avatar Mar 31 '25 19:03 avivkeller