Sometimes I've been getting this error while using puppeteer but since I haven't found a way around it. I just wrote code that will unlink it after the browser closes. Although sometimes Puppeteer will crash the whole process when this happens. Is there a way to detect this crash and be able to do error handling?
[Error: EPERM: operation not permitted, unlink 'C:\Users\user\AppData\Local\Temp\puppeteer_dev_chrome_profile-8gwzA9\CrashpadMetrics-active.pma'] {
errno: -4048,
code: 'EPERM',
syscall: 'unlink',
path: 'C:\\Users\\user\\AppData\\Local\\Temp\\puppeteer_dev_chrome_profile-8gwzA9\\CrashpadMetrics-active.pma'
}
Right now I'm using child.on("error", exithandler)
but it doesn't seem to work on this error.
var child = spawn(process.execPath, [__filename, "child"], {
stdio: ["inherit", "inherit", "inherit", "ipc"],
});
child.on("error", (err) =>{
console.log(`process ${child.pid} crashed with error: ` + err)
})