Thanks you for clicking on this question.
I am trying to restart a nodeJS process, without external libraries.
I did this code:
function restartProcess() {
spawn(process.argv[1], process.argv.slice(2), {
detached: true,
stdio: ['ignore', out, err]
}).unref()
process.exit()
}
bot.on( "kicked", (reason) => {
console.log("KICKED! "+ reason)
restartProcess()
})
But, when restartProcess() is called, i get error:
C:UsersToshibaDesktopprogrammineflayerspbotot.js:7
stdio: ['ignore', out, err]
^
ReferenceError: out is not defined
at restartProcess (C:UsersToshibaDesktopprogrammineflayerspbotot.js:7:25)
at EventEmitter.<anonymous> (bot.js:54:5)
at EventEmitter.emit (events.js:315:20)
at Client.<anonymous> (C:UsersToshiba
ode_modulesmineflayerlibpluginskick.js:5:9)
at Client.emit (events.js:315:20)
at FullPacketParser.<anonymous> (C:UsersToshiba
ode_modulesminecraft-protocolsrcclient.js:89:12)
at FullPacketParser.emit (events.js:315:20)
at addChunk (C:UsersToshiba
ode_modules
eadable-streamlib\_stream_readable.js:298:12)
at readableAddChunk (C:UsersToshiba
ode_modules
eadable-streamlib\_stream_readable.js:280:11)
at FullPacketParser.Readable.push (C:UsersToshiba
ode_modules
eadable-streamlib\_stream_readable.js:241:10)
Any help would be VERY appreciated!
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…