Después de cambiar a mi computadora portátil desde mi escritorio, cada vez que intento ejecutar un programa de titiritero, aparece el siguiente error:
(node:69) UnhandledPromiseRejectionWarning: TimeoutError: Timed out after 30000 ms while trying to connect to the browser! Only Chrome at revision r901912 is guaranteed to work. at Timeout.onTimeout (/mnt/c/Users/trgre/OneDrive/Desktop/puppeteer-Core/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:208:20) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) (node:69) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1) (node:69) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.La causa más probable es que el controlador de Puppeteer no coincida con su versión de Chromeium.
De los documentos:
Nota: cuando instala Puppeteer, descarga una versión reciente de Chromium (~170 MB Mac, ~282 MB Linux, ~280 MB Win) que está garantizado para funcionar con la API. Para omitir la descarga, descargar en otra ruta o descargar un navegador diferente, consulte Variables de entorno .
Allí encontrarás una variable de entorno: PUPPETEER_CHROMIUM_REVISION
Alternativamente, puede reinstalar Puppeteer y permitirle instalar la versión correcta de Chromium.