Javascript 勇敢的浏览器不与木偶演员合作。Brave无法读取和写入其数据目录

Javascript 勇敢的浏览器不与木偶演员合作。Brave无法读取和写入其数据目录,javascript,google-chrome,puppeteer,browser-cache,brave,Javascript,Google Chrome,Puppeteer,Browser Cache,Brave,这是我的代码: const puppeteer = require('puppeteer'); (async()=>{ const browser = await puppeteer.launch({ executablePath:"/mnt/c/Program Files (x86)/BraveSoftware/Brave-Browser/Application/brave.exe", headless:false,

这是我的代码:

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")
})()
当我运行js文件时,我收到以下错误:

(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.
另一个弹出错误是:

Brave cannot read and write to its Data directory
/tmp/puppeteer_dev_chrome_profile-CGzsOE

我真的需要帮助来解决这个问题,我已经尝试了很多东西,比如没有指定数据目录,但什么都不起作用。

你检查过目录的权限了吗?这个问题似乎也有类似的问题:是的,我有,我甚至对目录做了“chmod777”。我还尝试了脚本,但没有指定目录,这意味着我没有args参数。当我没有args参数时,它每次都会在错误消息中生成一个新的puppeter_dev_chrome_配置文件,尽管我的/tmp/文件夹中不存在。