process.execve(file[, args[, env]])


稳定性: 1 - 实验性

  • file <string> 要运行的可执行文件的名称或路径。
  • args <string[]> 字符串参数列表。任何参数都不能包含空字节()。
  • env <Object> 环境键值对。键或值不能包含空字节 (\u0000)。默认值: process.env

用新进程替换当前进程。

【Replaces the current process with a new process.】

这是通过使用 execve POSIX 函数实现的,因此当前进程的内存或其他资源不会被保留,除了标准输入、标准输出和标准错误文件描述符之外。

【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.】

当进程被交换时,系统会丢弃所有其他资源,而不会触发任何退出或关闭事件,也不会运行任何清理处理程序。

【All other resources are discarded by the system when the processes are swapped, without triggering any exit or close events and without running any cleanup handler.】

除非发生错误,否则此函数永远不会返回。

【This function will never return, unless an error occurred.】

此函数在 Windows 和 IBM i 上不可用。

【This function is not available on Windows or IBM i.】