File tree Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Expand file tree Collapse file tree 2 files changed +16
-4
lines changed Original file line number Diff line number Diff line change @@ -217,5 +217,11 @@ const stopPlugin = async function ({
217
217
} )
218
218
childProcess . disconnect ( )
219
219
}
220
- childProcess . kill ( )
220
+ try {
221
+ childProcess . kill ( )
222
+ } catch {
223
+ // In Node 22, there's a bug where attempting to kill a child process
224
+ // results in an EPERM error. Ignore the error in that case.
225
+ // See: https://github.com/nodejs/node/issues/51766
226
+ }
221
227
}
Original file line number Diff line number Diff line change @@ -43,9 +43,15 @@ const killProcess = (ps: ExecaChildProcess<string>) => {
43
43
ps . on ( 'close' , resolve )
44
44
ps . on ( 'error' , reject )
45
45
46
- ps . kill ( 'SIGTERM' , {
47
- forceKillAfterTimeout : SERVER_KILL_TIMEOUT ,
48
- } )
46
+ try {
47
+ ps . kill ( 'SIGTERM' , {
48
+ forceKillAfterTimeout : SERVER_KILL_TIMEOUT ,
49
+ } )
50
+ } catch {
51
+ // In Node 22, there's a bug where attempting to kill a child process
52
+ // results in an EPERM error. Ignore the error in that case.
53
+ // See: https://github.com/nodejs/node/issues/51766
54
+ }
49
55
} )
50
56
}
51
57
You can’t perform that action at this time.
0 commit comments