Troubleshooting
To keep this page up-to-date we largely rely on community contributions. -Please send a PR if you notice something is no longer up-to-date.
Cannot find module 'puppeteer-core/internal/...'
This can occur if your Node.js version is lower than 14 or if you are using a +Please send a PR if you notice something is no longer up-to-date.
Cannot find module 'puppeteer-core/internal/...'
+This can occur if your Node.js version is lower than 14 or if you are using a
custom resolver (such as
jest-resolve
). For the former,
we do not support deprecated versions of Node.js. For the latter, usually
upgrading the resolver (or its parent module such as jest
) will work (e.g.
-https://github.com/puppeteer/puppeteer/issues/9121)
Could not find expected browser locally
Starting from v19.0.0, Puppeteer will download browsers into +https://github.com/puppeteer/puppeteer/issues/9121)
+Could not find expected browser locally
+Starting from v19.0.0, Puppeteer will download browsers into
~/.cache/puppeteer
using
os.homedir
for better caching
between Puppeteer upgrades. Generally the home directory is well-defined (even
on Windows), but occasionally the home directory may not be available. In this
case, we provide the PUPPETEER_CACHE_DIR
variable which allows you to change
-the installation directory.
For example,
PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer
PUPPETEER_CACHE_DIR=$(pwd) node <script-path>
You can also create a configuration file named .puppeteerrc.cjs
(or
-puppeteer.config.cjs
) at the root of your application with the contents
const {join} = require('path');
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
You will need to reinstall puppeteer
in order for the configuration to take
+the installation directory.
For example,
+PUPPETEER_CACHE_DIR=$(pwd) npm install puppeteer
PUPPETEER_CACHE_DIR=$(pwd) node <script-path>
You can also create a configuration file named .puppeteerrc.cjs
(or
+puppeteer.config.cjs
) at the root of your application with the contents
const {join} = require('path');
/**
* @type {import("puppeteer").Configuration}
*/
module.exports = {
cacheDirectory: join(__dirname, '.cache', 'puppeteer'),
};
You will need to reinstall puppeteer
in order for the configuration to take
effect. See Configuring Puppeteer for more
-information.
Chrome headless doesn't launch on Windows
Some chrome policies might -enforce running Chrome/Chromium with certain extensions.
Puppeteer passes --disable-extensions
flag by default and will fail to launch
-when such policies are active.
To work around this, try running without the flag:
const browser = await puppeteer.launch({
ignoreDefaultArgs: ['--disable-extensions'],
});
+information. ++Chrome headless doesn't launch on Windows
+Some chrome policies might +enforce running Chrome/Chromium with certain extensions.
+Puppeteer passes
+--disable-extensions
flag by default and will fail to launch +when such policies are active.To work around this, try running without the flag:
++const browser = await puppeteer.launch({
ignoreDefaultArgs: ['--disable-extensions'],
});Context: issue 3681.
-Chrome doesn't launch on Linux
Make sure all the necessary dependencies are installed. You can run
ldd chrome | grep not
on a Linux machine to check which dependencies are missing. The +
Chrome doesn't launch on Linux
+Make sure all the necessary dependencies are installed. You can run ldd chrome | grep not
on a Linux machine to check which dependencies are missing. The
common ones are provided below. Also, see
https://source.chromium.org/chromium/chromium/src/+/main:chrome/installer/linux/debian/dist_package_versions.json
-for the up-to-date list of dependencies declared by the Chrome installer.
Chrome currently does not provide arm64 binaries for Linux. +for the up-to-date list of dependencies declared by the Chrome installer.
+Chrome currently does not provide arm64 binaries for Linux. There are only arm64 binaries for Mac ARM. -That means that Linux binaries downloaded by default will not work on Linux arm64.