Add ability to pass flags to Node instance #100
Copy link
Copy link
Closed
nodejs/node
#59560Description
I am trying to write a program that accesses the internal package from Node.js. To do this in most apps I would typically pass:
To handle this edgecase.
However, it seems that doing this after-the-executable generation does not appear to do anything.
.\its-node.exe --expose-internals
node:internal/util/embedding:48
throw new ERR_UNKNOWN_BUILTIN_MODULE(id);
^
Error [ERR_UNKNOWN_BUILTIN_MODULE]: No such built-in module: internal/fs/utils
at embedderRequire (node:internal/util/embedding:48:11)
at ./out/bundle.js:3197:5
at embedderRunCjs (node:internal/util/embedding:37:10) {
code: 'ERR_UNKNOWN_BUILTIN_MODULE'
}
Node.js v22.2.0Moreover, it would be nice if my users didn't have to pass a flag of any kind, as the option was enabled from the executable to begin with.
Thanks for your efforts on this and taking the time to read through the request 😊
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
jasonolmstead33 commentedon Sep 24, 2024
In the past, ive used NODE_OPTIONS to pass a node option to the SEA.
ex:
NODE_OPTIONS="--no-warnings" ./serverGive that a try?
crutchcorn commentedon Sep 24, 2024
Right, but I'd love for the
NODE_OPTIONSto be embedded into./serverjasonolmstead33 commentedon Sep 24, 2024
ah yes, I agree. make it part of the blob when building the SEA or something
joyeecheung commentedon Aug 1, 2025
I wrote some thoughts about how to support this in nodejs/node#51688 (comment)
sea: support execArgv in sea config
sea: support execArgv in sea config
sea: implement execArgvExtension
sea: implement execArgvExtension
sea: support execArgv in sea config
sea: implement execArgvExtension