1
因此,我正在處理Windows上的一個問題,我無法殺死使用shell.exec(...)產生的進程。shelljs - 獲取由shelljs.exec()創建的進程的進程ID()進程
我創建這樣的過程:
const shell = require('shelljs');
// ...
let childProcess = shell.exec('someBinary --whatever', { async: true });
然後試圖殺死它是這樣的:
childProcess.kill();
在* nix但Windows其中一期工程(出於某種原因) 。因此,我試圖獲取由shell.exec()進程創建的進程的進程ID('someBinary --whatever'),並使用它在稍後時間終止進程。
獲得shell.exec()進程的PID是微不足道的,但我無法弄清楚如何獲得它產生的進程的PID。
任何幫助將是偉大的。
圖例。 乾杯隊友 – ajcmurray
@ajcmurray http://stackoverflow.com/help/someone-answers –
對不起@ stdof--我陷入了實施解決方案 – ajcmurray