diff --git a/404.html b/404.html index ff9dfaff9df..ab58920e6e5 100644 --- a/404.html +++ b/404.html @@ -6,7 +6,7 @@
Cannot find module 'puppeteer-core/internal/...'
",id:"cannot-find-module-puppeteer-coreinternal",level:2},{value:"Could not find expected browser locally
",id:"could-not-find-expected-browser-locally",level:2},{value:"Chrome headless doesn't launch on Windows",id:"chrome-headless-doesnt-launch-on-windows",level:2},{value:"Chrome doesn't launch on Linux",id:"chrome-doesnt-launch-on-linux",level:2},{value:"Chrome headless disables GPU compositing",id:"chrome-headless-disables-gpu-compositing",level:2},{value:"Setting Up Chrome Linux Sandbox",id:"setting-up-chrome-linux-sandbox",level:2},{value:"[recommended] Enable user namespace cloning",id:"recommended-enable-user-namespace-cloning",level:3},{value:"[alternative] Setup setuid sandbox",id:"alternative-setup-setuid-sandbox",level:3},{value:"Running Puppeteer on Travis CI",id:"running-puppeteer-on-travis-ci",level:2},{value:"Running Puppeteer on WSL (Windows subsystem for Linux)",id:"running-puppeteer-on-wsl-windows-subsystem-for-linux",level:2},{value:"Running Puppeteer on CircleCI",id:"running-puppeteer-on-circleci",level:2},{value:"Running Puppeteer in Docker",id:"running-puppeteer-in-docker",level:2},{value:"Running on Alpine",id:"running-on-alpine",level:3},{value:"Running Puppeteer on GitlabCI",id:"running-puppeteer-on-gitlabci",level:2},{value:"Tips",id:"tips",level:4},{value:"Running Puppeteer in the cloud",id:"running-puppeteer-in-the-cloud",level:2},{value:"Running Puppeteer on Google App Engine",id:"running-puppeteer-on-google-app-engine",level:3},{value:"Running Puppeteer on Google Cloud Functions",id:"running-puppeteer-on-google-cloud-functions",level:3},{value:"Running Puppeteer on Google Cloud Run",id:"running-puppeteer-on-google-cloud-run",level:3},{value:"Running Puppeteer on Heroku",id:"running-puppeteer-on-heroku",level:3},{value:"Running Puppeteer on AWS Lambda",id:"running-puppeteer-on-aws-lambda",level:3},{value:"Running Puppeteer on AWS EC2 instance running Amazon-Linux",id:"running-puppeteer-on-aws-ec2-instance-running-amazon-linux",level:3},{value:"Code Transpilation Issues",id:"code-transpilation-issues",level:2}];function d(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsx)(n.p,{children:"Chromium currently does not provide arm64 binaries for Linux. There are only\nbinaries for Mac ARM."})}),"\n",(0,r.jsx)(n.h2,{id:"cannot-find-module-puppeteer-coreinternal",children:(0,r.jsx)(n.code,{children:"Cannot find module 'puppeteer-core/internal/...'"})}),"\n",(0,r.jsxs)(n.p,{children:["This can occur if your Node.js version is lower than 14 or if you are using a\ncustom resolver (such as\n",(0,r.jsx)(n.a,{href:"https://www.npmjs.com/package/jest-resolve",children:(0,r.jsx)(n.code,{children:"jest-resolve"})}),"). For the former,\nwe do not support deprecated versions of Node.js. For the latter, usually\nupgrading the resolver (or its parent module such as ",(0,r.jsx)(n.code,{children:"jest"}),") will work (e.g.\n",(0,r.jsx)(n.a,{href:"https://github.com/puppeteer/puppeteer/issues/9121",children:"https://github.com/puppeteer/puppeteer/issues/9121"}),")"]}),"\n",(0,r.jsx)(n.h2,{id:"could-not-find-expected-browser-locally",children:(0,r.jsx)(n.code,{children:"Could not find expected browser locally"})}),"\n",(0,r.jsxs)(n.p,{children:["Starting from v19.0.0, Puppeteer will download browsers into\n",(0,r.jsx)(n.code,{children:"~/.cache/puppeteer"})," using\n",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/os.html#oshomedir",children:(0,r.jsx)(n.code,{children:"os.homedir"})})," for better caching\nbetween Puppeteer upgrades. Generally the home directory is well-defined (even\non Windows), but occasionally the home directory may not be available. In this\ncase, we provide the ",(0,r.jsx)(n.code,{children:"PUPPETEER_CACHE_DIR"})," variable which allows you to change\nthe installation directory."]}),"\n",(0,r.jsx)(n.p,{children:"For example,"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer\nPUPPETEER_CACHE_DIR=$(pwd) node Cannot find module 'puppeteer-core/internal/...'
",id:"cannot-find-module-puppeteer-coreinternal",level:2},{value:"Could not find expected browser locally
",id:"could-not-find-expected-browser-locally",level:2},{value:"Chrome headless doesn't launch on Windows",id:"chrome-headless-doesnt-launch-on-windows",level:2},{value:"Chrome doesn't launch on Linux",id:"chrome-doesnt-launch-on-linux",level:2},{value:"Chrome headless disables GPU compositing",id:"chrome-headless-disables-gpu-compositing",level:2},{value:"Setting Up Chrome Linux Sandbox",id:"setting-up-chrome-linux-sandbox",level:2},{value:"[recommended] Enable user namespace cloning",id:"recommended-enable-user-namespace-cloning",level:3},{value:"[alternative] Setup setuid sandbox",id:"alternative-setup-setuid-sandbox",level:3},{value:"Running Puppeteer on Travis CI",id:"running-puppeteer-on-travis-ci",level:2},{value:"Running Puppeteer on WSL (Windows subsystem for Linux)",id:"running-puppeteer-on-wsl-windows-subsystem-for-linux",level:2},{value:"Running Puppeteer on CircleCI",id:"running-puppeteer-on-circleci",level:2},{value:"Running Puppeteer in Docker",id:"running-puppeteer-in-docker",level:2},{value:"Running on Alpine",id:"running-on-alpine",level:3},{value:"Running Puppeteer on GitlabCI",id:"running-puppeteer-on-gitlabci",level:2},{value:"Tips",id:"tips",level:4},{value:"Running Puppeteer in the cloud",id:"running-puppeteer-in-the-cloud",level:2},{value:"Running Puppeteer on Google App Engine",id:"running-puppeteer-on-google-app-engine",level:3},{value:"Running Puppeteer on Google Cloud Functions",id:"running-puppeteer-on-google-cloud-functions",level:3},{value:"Running Puppeteer on Google Cloud Run",id:"running-puppeteer-on-google-cloud-run",level:3},{value:"Running Puppeteer on Heroku",id:"running-puppeteer-on-heroku",level:3},{value:"Running Puppeteer on AWS Lambda",id:"running-puppeteer-on-aws-lambda",level:3},{value:"Running Puppeteer on AWS EC2 instance running Amazon-Linux",id:"running-puppeteer-on-aws-ec2-instance-running-amazon-linux",level:3},{value:"Code Transpilation Issues",id:"code-transpilation-issues",level:2}];function d(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,i.a)(),...e.components},{Details:s}=n;return s||function(e,n){throw new Error("Expected "+(n?"component":"object")+" `"+e+"` to be defined: you likely forgot to import, pass, or provide it.")}("Details",!0),(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.h1,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,r.jsx)(n.admonition,{type:"caution",children:(0,r.jsx)(n.p,{children:"Chromium currently does not provide arm64 binaries for Linux. There are only\nbinaries for Mac ARM."})}),"\n",(0,r.jsx)(n.h2,{id:"cannot-find-module-puppeteer-coreinternal",children:(0,r.jsx)(n.code,{children:"Cannot find module 'puppeteer-core/internal/...'"})}),"\n",(0,r.jsxs)(n.p,{children:["This can occur if your Node.js version is lower than 14 or if you are using a\ncustom resolver (such as\n",(0,r.jsx)(n.a,{href:"https://www.npmjs.com/package/jest-resolve",children:(0,r.jsx)(n.code,{children:"jest-resolve"})}),"). For the former,\nwe do not support deprecated versions of Node.js. For the latter, usually\nupgrading the resolver (or its parent module such as ",(0,r.jsx)(n.code,{children:"jest"}),") will work (e.g.\n",(0,r.jsx)(n.a,{href:"https://github.com/puppeteer/puppeteer/issues/9121",children:"https://github.com/puppeteer/puppeteer/issues/9121"}),")"]}),"\n",(0,r.jsx)(n.h2,{id:"could-not-find-expected-browser-locally",children:(0,r.jsx)(n.code,{children:"Could not find expected browser locally"})}),"\n",(0,r.jsxs)(n.p,{children:["Starting from v19.0.0, Puppeteer will download browsers into\n",(0,r.jsx)(n.code,{children:"~/.cache/puppeteer"})," using\n",(0,r.jsx)(n.a,{href:"https://nodejs.org/api/os.html#oshomedir",children:(0,r.jsx)(n.code,{children:"os.homedir"})})," for better caching\nbetween Puppeteer upgrades. Generally the home directory is well-defined (even\non Windows), but occasionally the home directory may not be available. In this\ncase, we provide the ",(0,r.jsx)(n.code,{children:"PUPPETEER_CACHE_DIR"})," variable which allows you to change\nthe installation directory."]}),"\n",(0,r.jsx)(n.p,{children:"For example,"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-bash",children:"PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer\nPUPPETEER_CACHE_DIR=$(pwd) node sudo sysctl -w kernel.unprivileged_userns_clone=1
The setuid sandbox comes as a standalone executable and is located next to the -Chromium that Puppeteer downloads. It is fine to re-use the same sandbox -executable for different Chromium versions, so the following could be done only +Chrome that Puppeteer downloads. It is fine to re-use the same sandbox +executable for different Chrome versions, so the following could be done only once per host environment:
-# cd to the downloaded instance
cd <project-dir-path>/node_modules/puppeteer/.local-chromium/linux-<revision>/chrome-linux/
sudo chown root:root chrome_sandbox
sudo chmod 4755 chrome_sandbox
# copy sandbox executable to a shared location
sudo cp -p chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
# export CHROME_DEVEL_SANDBOX env variable
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
# cd to Puppeteer cache directory (adjust the path if using a different cache directory).
cd ~/.cache/puppeteer/chrome/linux-<version>/chrome-linux64/
sudo chown root:root chrome_sandbox
sudo chmod 4755 chrome_sandbox
# copy sandbox executable to a shared location
sudo cp -p chrome_sandbox /usr/local/sbin/chrome-devel-sandbox
# export CHROME_DEVEL_SANDBOX env variable
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
You might want to export the CHROME_DEVEL_SANDBOX
env variable by default. In
this case, add the following to the ~/.bashrc
or .zshenv
:
export CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox
or to your Dockerfile
:
ENV CHROME_DEVEL_SANDBOX /usr/local/sbin/chrome-devel-sandbox
👋 We ran our tests for Puppeteer on Travis CI until v6.0.0 (when we've diff --git a/next/webdriver-bidi/index.html b/next/webdriver-bidi/index.html index 55dde90f08a..7f9b6cb9418 100644 --- a/next/webdriver-bidi/index.html +++ b/next/webdriver-bidi/index.html @@ -6,7 +6,7 @@
Experimental WebDriver BiDi support | Puppeteer - + diff --git a/search/index.html b/search/index.html index 4819b6098d2..cc55922f3c5 100644 --- a/search/index.html +++ b/search/index.html @@ -6,7 +6,7 @@Search the documentation | Puppeteer - + diff --git a/troubleshooting/index.html b/troubleshooting/index.html index a08e3d7a515..75292e5827f 100644 --- a/troubleshooting/index.html +++ b/troubleshooting/index.html @@ -6,7 +6,7 @@Troubleshooting | Puppeteer - + diff --git a/webdriver-bidi/index.html b/webdriver-bidi/index.html index 1328f3ab8e7..a1ed80cd827 100644 --- a/webdriver-bidi/index.html +++ b/webdriver-bidi/index.html @@ -6,7 +6,7 @@Experimental WebDriver BiDi support | Puppeteer - +