-
Notifications
You must be signed in to change notification settings - Fork 9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is:issue is:open When you install Puppeteer, it does not download a recent version of Chromium #6586
Comments
I get the same error as you on Macos (Catalina) with version 5.4.1 |
Are you using npm 6 or npm 7? |
Instead of trying to find out how to use the installed chrome, I just did an npm remove and then installed puppeteer (non-core) instead. Problem fixed. |
@swissspidy npm version 6.14.8 |
I am able to reproduce this in a clean repository
|
Despite npm/cli#1905 being fixed for `npm@7.1.2`, there are still issues with installing `puppeteer` using `npm@7`. See puppeteer/puppeteer#6586 (comment) Therefore, we're reverting the accidental schema upgrade from 0d1e40b to the previous version, and removing `markdownlint-cli` once more.
Despite npm/cli#1905 being fixed for `npm@7.1.2`, there are still issues with installing `puppeteer` using `npm@7`. See puppeteer/puppeteer#6586 (comment) Therefore, we're reverting the accidental schema upgrade from 0d1e40b to the previous version, and removing `markdownlint-cli` once more.
Was anyone able to figure how to solve this issue? I started getting this error today and I'm not sure what else I can do. I've tried removing puppeteer and re-installing (7.1.0 & 8.0.0), using different versions of node (8.15.1, 10.16.3 & 14.16.0) and npm(6.9.0 & 7.7.6) and keep getting the error:
I'm trying to run a Backstopjs(https://github.com/garris/BackstopJS - v5.3.0) test but it seems like puppeteer still can't find chrome. Any help would really be appreaciated. |
I haven't confirmed this fix yet (by reproducing bug & fix). But explicitly installing
Running npm version 6.13.4:
I'll certainly come back and reply / edit if I find out I can't reproduce this fix. |
This is still reproducible for me on npm 7.21.0 and puppeteer 7.0.0.
May be related:
|
Indeed the instruction, "Run |
@rmschindler The problem is most likely that the package you are installing has a shrinkwrap that was generated with npm 6 or earlier. The npm 7 release has been a mess of all kinds of poorly understood breaking changes, one of which being that postinstall scripts are completely ignored when a "v1" lockfile/shrinkwrap is at play. If there is no lock file, or if the lock file was generated with npm 7+, then it's all fine. It's rather annoying and unfortunate, but it is easy to fix once realized assuming you own the lockfile in question. If the top-level package installed with Note that the puppeteer package itself does not have this problem, but you may be working on a project or using a package that uses a lockfile locally. Also note that, while npm 7+ requires a v2/npm7+ lockfile in order to install puppeteer correctly, doing so does not break compatibility with npm 6 so this should be an uncontroversial thing to change in any project or package. That is, if you update your lock file with npm 7+ to the v2 lock format, it will still work correctly with npm 6. And unlike the "backwards compatibility" that npm 7 provides for v1 lock files (which is broken, per this issue), the forwards-compatibility that npm 6 has for v2 lock files does actually work correctly in regards to postinstall scripts for Puppeteer. |
This simplifies setup and avoids a recuring issue when running "npm install" in the main package would result in infinite looping of calling the postinstall script. It also makes sensei publisable to npm more easily. Due to puppeteer/puppeteer#6586 (comment), chrome was not being downloaded when running npm install. I had to fork and patch decktape. Let's hope the patch is merged and released. See astefanutti/decktape#237. Otherwise we could publish the fork.
This upgrades npm-shrinkwrap.json to lockfile version 2, which is the format introduced by npm v7. This fixes chrome not being downloaded when installing decktape as a dependency in a project using npm v7+. See puppeteer/puppeteer#6586 (comment). The new format is backward compatible so users of npm v6 and lower should not be impacted.
This simplifies setup and avoids a recuring issue when running "npm install" in the main package would result in infinite looping of calling the postinstall script. It also makes sensei publishable to npm more easily. The PDF part was originally split for the main package to avoid having to install Chrome twice when developing, often in cases where I wasn't even touching the PDF part. However, as mentioned by @patou, a better technique to do that is to run `npm install` with `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` defined. This also downgrades puppeteer from 11.0.0 to 10.4.0 to align to the version used by decktape 3.3.0 and allow npm to dedupe puppeteer and reduce the number of Chrome installs to 1. It does work in contrary from what I said in #120. Due to puppeteer/puppeteer#6586 (comment), chrome was not being downloaded when running npm install. I had to fork and patch decktape. See astefanutti/decktape#237. The patch has been merged but not release so for now package.json points to the master branch of decktape instead of release. This should be changed as soon as decktape has a new release.
We're marking this issue as unconfirmed because it has not had recent activity and we weren't able to confirm it yet. It will be closed if no further activity occurs within the next 30 days. |
Confirmed this is also happening for me |
We generally rely on npm to run the install scripts which download the binary: the install command is only able to download a single Chromium version so it's not possible for it to download an older version. Also, I am not able to reproduce this issue with the latest versions of things. I am going to mark this issue as closed and @markcellus as it seems it happened to you recently, would you mind opening a new issue with a repro repository and all details about your npm/node/OS versions? |
when installing Puppeteer using
npm install puppeteer
, it does not download a recent version of Chromium as it is mentioned in the documentation.When using
puppeteer.launch({product: 'chrome'})
, I found out it is looking for this folder:node_modules/puppeteer/.local-chromium/mac-756035
which does not exist. And it does not attempt to download.Notes:
In version 5.0.0 I get the following error:
Where as in version 5.4.1 I get a different error:
Which is even stranger cause I explicitly used
product: 'chrome'
in the launch options.Error is at
puppeteer/src/node/Launcher.ts
Line 751 in 6d06ade
cause the
executablePath
is something like:node_modules/puppeteer/.local-chromium/mac-756035
which does not exist.puppeteer/src/node/Launcher.ts
Line 773 in 6d06ade
The text was updated successfully, but these errors were encountered: