gpt4 book ai didi

typescript - Playwright - 当 Chromium 位于 node_modules 中时无法启动 Chromium(Azure 函数 - Linux 和 Windows)

转载 作者:行者123 更新时间:2023-12-02 23:11:38 28 4
gpt4 key购买 nike

我创建了一个使用 Playwright 的 Azure 函数。它在本地工作,好吧,那部分不会改变)

然后我创建了 Azure DevOps 管道,因此它使用 Ubuntu 代理,使用 PLAYWRIGHT_BROWSERS_PATH=0 进行构建,因此 Chromium 被下载到 node_modules(我在那里看到它) )。然后发布到Linux Azure Function。

但是当该函数在 Azure 中运行时,这一行:

  const crBrowser = await chromium.launch({
executablePath:
"./node_modules/playwright-chromium/.local-browsers/chromium-827102/chrome-linux/chrome",
});

抛出此错误:

Error: spawn ./node_modules/playwright-chromium/.local-browsers/chromium-827102/chrome-linux/chrome EACCES=========================== logs =========================== ./node_modules/playwright-chromium/.local-browsers/chromium-827102/chrome-linux/chrome --disable-background-networking --enable-features=NetworkService,NetworkServiceInProcess --disable-background-timer-throttling --disable-backgrounding-occluded-windows --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-background-pages --disable-default-apps --disable-dev-shm-usage --disable-extensions --disable-features=TranslateUI,BlinkGenPropertyTrees,ImprovedCookieControls,SameSiteByDefaultCookies,LazyFrameLoading --disable-hang-monitor --disable-ipc-flooding-protection --disable-popup-blocking --disable-prompt-on-repost --disable-renderer-backgrounding --disable-sync --force-color-profile=srgb --metrics-recording-only --no-first-run --enable-automation --password-store=basic --use-mock-keychain --user-data-dir=/tmp/playwright_chromiumdev_profile-JZVt2S --remote-debugging-pipe --headless --hide-scrollbars --mute-audio --blink-settings=primaryHoverType=2,availableHoverTypes=2,primaryPointerType=4,availablePointerTypes=4 --no-sandbox --no-startup-window============================================================

我在 Windows 和 Linux 上尝试过这个 - 相同的事情,只是措辞不同。

最佳答案

Anthony Chu(评论中提到的文章的作者,也是让我首先尝试此操作的人)回答说,他无法使其与剧作家敏锐的作品一起工作。它仅适用于 puppeteer-sharp。

关于typescript - Playwright - 当 Chromium 位于 node_modules 中时无法启动 Chromium(Azure 函数 - Linux 和 Windows),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65067095/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com