Running headless Chrome / Puppeteer with --no-sandbox

后端 未结 4 1786
青春惊慌失措
青春惊慌失措 2020-12-16 04:02

Background

I built an application that uses Puppeteer on my localhost. Now that I am trying to deploy it into a debian environment the script that r

4条回答
  •  悲&欢浪女
    2020-12-16 04:36

    In your nodejs code when you launch your browser, you can pass the --no-sandbox argument.

    example:-

    const launchBrowser = async () => {
      puppetBrowser = await puppeteer.launch({
        args: ['--no-sandbox'],
        timeout: 10000,
      });
    };
    

提交回复
热议问题