Node,kill cannot kill the process.

  node.js, question

Recently, I want to play Electronic, so I want to use gulp to rebuild automatically when developing Electronic.
Electron build’s command iselectorn .. So I used child_process to execute the command in gulp.electorn .However, when I checked that there was a change in the file and wanted to kill the original process, I really couldn’t succeed. Can anyone please take a look?
The code for gulpfile.js is as follows

let gulp = require("gulp");
 let exec = require("child_process").exec;
 
 let electron;
 const BUILD_COMMAND = "electron .";
 
 gulp.task("build",function () {
 electron = exec(BUILD_COMMAND);
 });
 
 gulp.task("rebuild",function () {
 if(electron){
 electron.kill("SIGINT");
 bracket
 electron = exec(BUILD_COMMAND);
 });
 
 gulp.task("watch",function () {
 gulp.watch(["main.js","index.html"],["rebuild"]);
 });
 
 gulp.task("default",["build","watch"]);

SIGINTInstead of shutting down the process, the keyboard was interrupted. Use defaultSIGTERMThat’s it. kill (). For documents checked temporarily, it is recommended to look at the official documents, and child process has not been used.
Node child_process document
Signal list