this is my code:
const puppeteer = require('puppeteer');
(async()=>{
const browser = await puppeteer.launch({
executablePath:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe",
headless:false,
args:['--user-data-dir=/tmp/puppeteer_dev_chrome_profile-CGzsOE/'],
ignoreDefaultArgs: true
})
const page = await browser.newPage()
page.goto("https://www.google.com")
})()
when I run my js file, I receive this error:
(node:522) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
[14964:4488:0907/043929.675:ERROR:cache_util_win.cc(21)] Unable to move the cache: Access is denied. (0x5)
[14964:4488:0907/043929.675:ERROR:cache_util.cc(139)] Unable to move cache folder C:\Users\dabas\AppData\Local\BraveSoftware\Brave-Browser\User Data\ShaderCache\GPUCache to C:\Users\dabas\AppData\Local\BraveSoftware\Brave-Browser\User Data\ShaderCache\old_GPUCache_000
[14964:4488:0907/043929.675:ERROR:disk_cache.cc(184)] Unable to create cache
[14964:4488:0907/043929.675:ERROR:shader_disk_cache.cc(606)] Shader Cache Creation failed: -2
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/mnt/c/Users/dabas/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:193:20)
at ChildProcess.helper_js_1.helper.addEventListener (/mnt/c/Users/dabas/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:184:79)
at ChildProcess.emit (events.js:203:15)
at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
(node:522) 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(). (rejection id: 1)
(node:522) [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.
and another pop-up error saying:
Brave cannot read and write to its Data directory
/tmp/puppeteer_dev_chrome_profile-CGzsOE
I really need help in fixing this, I've tried a lot of stuff already such as not specifying a data directory but nothing is working.