diff --git a/404.html b/404.html index 27c890f9a76..ab759b53f38 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 doesn't launch on Windows",id:"chrome-doesnt-launch-on-windows",level:2},{value:"Chrome reports sandbox errors on Windows",id:"chrome-reports-sandbox-errors-on-windows",level:2},{value:"Chrome doesn't launch on Linux",id:"chrome-doesnt-launch-on-linux",level:2},{value:"chrome-headless-shell disables GPU compositing",id:"chrome-headless-shell-disables-gpu-compositing",level:2},{value:"Setting up GPU with Chrome",id:"setting-up-gpu-with-chrome",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:"Running Puppeteer on Google Cloud Run",id:"running-puppeteer-on-google-cloud-run",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-1",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 p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components},{Details:r}=n;return r||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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"To keep this page up-to-date we largely rely on community contributions.\nPlease send a PR if you notice something is no longer up-to-date."})}),"\n",(0,s.jsx)(n.h2,{id:"cannot-find-module-puppeteer-coreinternal",children:(0,s.jsx)(n.code,{children:"Cannot find module 'puppeteer-core/internal/...'"})}),"\n",(0,s.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,s.jsx)(n.a,{href:"https://www.npmjs.com/package/jest-resolve",children:(0,s.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,s.jsx)(n.code,{children:"jest"}),") will work (e.g.\n",(0,s.jsx)(n.a,{href:"https://github.com/puppeteer/puppeteer/issues/9121",children:"https://github.com/puppeteer/puppeteer/issues/9121"}),")"]}),"\n",(0,s.jsx)(n.h2,{id:"could-not-find-expected-browser-locally",children:(0,s.jsx)(n.code,{children:"Could not find expected browser locally"})}),"\n",(0,s.jsxs)(n.p,{children:["Starting from v19.0.0, Puppeteer will download browsers into\n",(0,s.jsx)(n.code,{children:"~/.cache/puppeteer"})," using\n",(0,s.jsx)(n.a,{href:"https://nodejs.org/api/os.html#oshomedir",children:(0,s.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,s.jsx)(n.code,{children:"PUPPETEER_CACHE_DIR"})," variable which allows you to change\nthe installation directory."]}),"\n",(0,s.jsx)(n.p,{children:"For example,"}),"\n",(0,s.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(t.Z,{value:"npm",children:(0,s.jsx)(n.pre,{children:(0,s.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 doesn't launch on Windows",id:"chrome-doesnt-launch-on-windows",level:2},{value:"Chrome reports sandbox errors on Windows",id:"chrome-reports-sandbox-errors-on-windows",level:2},{value:"Chrome doesn't launch on Linux",id:"chrome-doesnt-launch-on-linux",level:2},{value:"chrome-headless-shell disables GPU compositing",id:"chrome-headless-shell-disables-gpu-compositing",level:2},{value:"Setting up GPU with Chrome",id:"setting-up-gpu-with-chrome",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:"Running Puppeteer on Google Cloud Run",id:"running-puppeteer-on-google-cloud-run",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-1",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 p(e){const n={a:"a",admonition:"admonition",blockquote:"blockquote",code:"code",h1:"h1",h2:"h2",h3:"h3",h4:"h4",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",ul:"ul",...(0,o.a)(),...e.components},{Details:r}=n;return r||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,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.h1,{id:"troubleshooting",children:"Troubleshooting"}),"\n",(0,s.jsx)(n.admonition,{type:"note",children:(0,s.jsx)(n.p,{children:"To keep this page up-to-date we largely rely on community contributions.\nPlease send a PR if you notice something is no longer up-to-date."})}),"\n",(0,s.jsx)(n.h2,{id:"cannot-find-module-puppeteer-coreinternal",children:(0,s.jsx)(n.code,{children:"Cannot find module 'puppeteer-core/internal/...'"})}),"\n",(0,s.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,s.jsx)(n.a,{href:"https://www.npmjs.com/package/jest-resolve",children:(0,s.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,s.jsx)(n.code,{children:"jest"}),") will work (e.g.\n",(0,s.jsx)(n.a,{href:"https://github.com/puppeteer/puppeteer/issues/9121",children:"https://github.com/puppeteer/puppeteer/issues/9121"}),")"]}),"\n",(0,s.jsx)(n.h2,{id:"could-not-find-expected-browser-locally",children:(0,s.jsx)(n.code,{children:"Could not find expected browser locally"})}),"\n",(0,s.jsxs)(n.p,{children:["Starting from v19.0.0, Puppeteer will download browsers into\n",(0,s.jsx)(n.code,{children:"~/.cache/puppeteer"})," using\n",(0,s.jsx)(n.a,{href:"https://nodejs.org/api/os.html#oshomedir",children:(0,s.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,s.jsx)(n.code,{children:"PUPPETEER_CACHE_DIR"})," variable which allows you to change\nthe installation directory."]}),"\n",(0,s.jsx)(n.p,{children:"For example,"}),"\n",(0,s.jsxs)(i.Z,{groupId:"npm2yarn",children:[(0,s.jsx)(t.Z,{value:"npm",children:(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-bash",children:"PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer\nPUPPETEER_CACHE_DIR=$(pwd) node If you encounter this issue, you will see errors like this in the browser stdout:
[24452:59820:0508/113713.058:ERROR:sandbox_win.cc(913)] Sandbox cannot access executable. Check filesystem permissions are valid. See https://bit.ly/31yqMJR.: Access is denied. (0x5)
To workaround the issue, use the icacls utility to set permissions manually:
-icacls $HOME/.cache/puppeteer/chrome /grant "ALL APPLICATION PACKAGES:(OI)(CI)(RX)"
icacls %USERPROFILE%/.cache/puppeteer/chrome /grant *S-1-15-2-1:(OI)(CI)(RX)
In high security environments a more restrictive SID should be used such as one from the installer.