process.execve
History
execve(2) system call now throws an exception instead of aborting the process. Native AtExit callbacks registered via the embedder API are no longer invoked before the execve(2) call.process.execve(file, args?, env?): void
Replaces the current process with a new process.
This is achieved by using the execve POSIX function and therefore no memory or other
resources from the current process are preserved, except for the standard input,
standard output and standard error file descriptor.
On success, all other resources are discarded by the system when the
processes are swapped, without triggering any exit or close events, without
running any JavaScript cleanup handler (for example process.on('exit')),
and without invoking native AtExit callbacks registered through the
embedder API. Callers that need to run cleanup logic should do so before
calling process.execve().
This function does not return on success. If the underlying execve(2)
system call fails, an Error is thrown whose code property is set to the
corresponding errno string (for example, 'ENOENT' when file does not
exist), with syscall set to 'execve' and path set to file. When
execve(2) fails the current process continues to run with its state
unchanged, so a caller may handle the error and take another action.
This function is not available on Windows or IBM i.