UXP does not provide a full Node environment. Calling out to a child process is not currently possible. We are adding support for launching external apps, but this won’t be quite the same as a child process (no watching stdout, for example). Any interprocess comms would have to be negotiated between plugin and launched app.
We were facing the same issue with our plugins which relied heavily on a full Node environment. Our solution was to build a Node application that runs aside from the plugin.
To communicate with the Node application we use WebSockets but you could also use XMLHttpRequests. It’s a bit of a drag but we managed to rebuild all features that we used to have in the old environment.
Currently it’s not possible to launch an application from UXP. So we add instructions to run an application besides the extension. We make a request to verify if the application is running, and display a message if it’s not the case.
As soon as there is an option to launch an external app we will probably simply show a button to launch the app.
As of Ps 23.3.x, you can use Manifest v5 (required) and require("shell").openExternal and require("shell").openPath. Users will be prompted for consent (they can remember their choice to avoid being prompted again).