puppeteer: ERROR Run npm install to download the correct Chromium revision (1056772)

Bug description

Steps to reproduce the problem:

  1. Deploy instance on render.com cloud working fine on localhost

Getting ERROR Run npm install to download the correct Chromium revision (1056772)

Oct 30 09:25:19 PM ERROR Run npm install to download the correct Chromium revision (1056772). Oct 30 09:25:19 PM
Oct 30 09:25:19 PM at ChromeLauncher.resolveExecutablePath (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:120:27) Oct 30 09:25:19 PM at ChromeLauncher.executablePath (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:166:25) Oct 30 09:25:19 PM at ChromeLauncher.launch (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:70:37) Oct 30 09:25:19 PM at async exports.convert_to_pdf (api/controllers/client.js:287:21)

Puppeteer version

19.2.0

Node.js version

10.15.0

npm version

8.19.2

What operating system are you seeing the problem on?

macOS

Configuration file

No response

Relevant log output

Oct 30 09:25:19 PM   ERROR  Run npm install to download the correct Chromium revision (1056772).
Oct 30 09:25:19 PM  
Oct 30 09:25:19 PM    at ChromeLauncher.resolveExecutablePath (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ProductLauncher.js:120:27)
Oct 30 09:25:19 PM    at ChromeLauncher.executablePath (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:166:25)
Oct 30 09:25:19 PM    at ChromeLauncher.launch (node_modules/puppeteer-core/lib/cjs/puppeteer/node/ChromeLauncher.js:70:37)
Oct 30 09:25:19 PM    at async exports.convert_to_pdf (api/controllers/client.js:287:21)

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 4
  • Comments: 28 (3 by maintainers)

Commits related to this issue

Most upvoted comments

I believe the file needs to be “.puppeteerrc.cjs” with a leading dot.

I also found that when patching an image (which runs “npm ci” on GAE Flex), I needed to add this to package.json when puppeteer gets upgraded:

{ “scripts”: { “postinstall”: “node node_modules/puppeteer/install.js”, } }

On Fri, Nov 11, 2022, 11:20 Adir Buskila @.***> wrote:

@gRoussac https://github.com/gRoussac I changed the puppeteerrc.cjs and still no luck any chance you’ll look at my repo and tell me what I’m missing? it’s a very small project and that puppeteer error is very frustrating repo: https://github.com/AdirBuskila/star-info

— Reply to this email directly, view it on GitHub https://github.com/puppeteer/puppeteer/issues/9192#issuecomment-1311910060, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAA7OLDEJ6EZKZ3TMSZYUCTWHZW4RANCNFSM6AAAAAARSLH57Y . You are receiving this because you are subscribed to this thread.Message ID: @.***>

Hi there, I’ve been getting the error from the post above trying to deploy on Render with Node.js

Nov 9 08:58:06 PM 1. you did not perform an installation before running the script (e.g. npm install) or Nov 9 08:58:06 PM 2. your cache path is incorrectly configured (which is: /opt/render/.cache/puppeteer). Nov 9 08:58:06 PM For (2), check out our guide on configuring puppeteer at https://pptr.dev/guides/configuration.Problemgetting star data at server

and this is my puppeteerrc.cjs

const { join } = require('path');

module.exports = { cacheDirectory: join(__dirname, '.cache', 'puppeteer'), };

any solution for this problem?

Running into this as well, I suspect it has to do with the breaking change

use ~/.cache/puppeteer for browser downloads (https://github.com/puppeteer/puppeteer/pull/9095)

In my case, dependencies are installed using a privileged system account and the app is run using a different unprivileged account. I suspect that since the cache path is now user-dependent, this is a new problem.

The unprivileged user in my case also has no home directory, so puppeteer 19.x is effectively broken for me.

While I appreciate the effort to reduce the filesystem bloat when using puppeteer across many apps, allowing puppeteer to install things outside the scope of node_modules appears to be a significant oversight.

To add to this problem @AdirBuskila. For build i have to type this:

npm install && node node_modules/puppeteer/install.js

and my .puppeteerrc.cjs :

const { join } = require("path");

/**
 * @type {import("puppeteer").Configuration}
 */
module.exports = {
  cacheDirectory: join(__dirname, ".cache", "puppeteer"),
};

If you add 'project/src/' to join it will add unnececery project/src because its already included in the path

@reyronald

But why is it installing it there if I’m specifying a different directory to install in with .puppeteerrc.cjs. The directory I was configuring it wasn’t even named .cache but it still ended up in /root/.cache

I can not answer that question,.puppeteerrc.cjs didn’t work for my case, imho there is a bug somewhere, when I tried a simple docker file to see the diffs with a Render install, something I noticed is that it was better to have Chrome being installed in /home/user/.cache/puppeteer and run the app with this user (moreover I don’t want to fetch untrusted sites as root). Then runtime would find /home/user/.cache/puppeteer.

@AdirBuskila Either try to change puppeteerrc.cjs to join(__dirname, 'project/src/' ,'.cache', 'puppeteer') or please try again, remove puppeteerrc.cjs, set the env var in Render (maybe creating a .cache folder at the root of your node app would help but I doubt) and npm install. The error should not be the same /opt/render/.cache/puppeteer is two levels higher than your app is. If you need to see where are some folders in Render logs, you can use classic linux commands like pwd && ls -al .cache && npm start for instance in start command.

@jrandolf I can assure you the cache directory is set up as in the documentation because like I said it works as expected when installing the package locally. I tried both the configuration file and the env var and made sure the config file was visible to the container when installing packages.

Didn’t see anything else obvious in the dockerfile that could be interfering. There’s no other package that could be overwriting this directory either.

You don’t have to answer though, like I said I’m already unblocked. Just wanted to document that for other folks who might run into this.

I had the same issue and wanted to stop by and describe the solution I ended up going with in case it can help someone else.

I was getting the error above when trying to use a Puppeteer based feature in a deployed environment which runs on a Docker container. I was not getting the error when running the app locally outside of Docker.

Specifying a local cache directory through configuration as described in the documentation here worked locally after rm -rf node_modules and running npm i again, but for some reason it did NOT work in my Docker container 🤷‍♂️. I made sure to docker-compose build a fresh empty image with no cache to guarantee that puppeteer was seeing the configuration file and using it to change its cache directory but it wasn’t being picked up. The resulting container did not have the cache directory I added in the .puppeteerrc.cjs and always used the default of <homedir>/.cache/puppeteer.

At this point I had already wasted too much time trying to figure it out so I gave up and just copied the default cache directory from the base stage of the Docker container to the release stage. In other words, I added this last step to my Dockerfile

COPY --from=extended /root/.cache/puppeteer /.cache/puppeteer

This solved the issue so I’m ok for now. Would like to know why the configuration file approach didn’t work just out of curiosity but probably won’t be able to get an answer to that.

Same issue here as @kfitzgerald, having really hard time to install Puppeteer on Ubuntu, my unprivileged account got the same error [Error: Run npm install to download the correct Chromium revision (1056772)] Would be really nice to have a step by step guide on how to solve this issue, as many of the links pointed out are now dead, for example: https://pptr.dev/guides/configuring-puppeteer Thanks for your help!

@kfitzgerald @gRoussac You can add a CJS configuration file with a cache directory that points to __dirname. I am not sure how this would be different from prod/dev (given the fact <19 behaviour can be replicated with the aforementioned method). Reinstallation is only required if you installed before modifying your configuration.

Please check our troubleshooting guide at pptr.dev

Also, check out guide on configuring puppeteer

Hi,

I have the same issue, adding a .puppeteerrc.cjs is crashing the whole angular app and /opt/render/.cache/puppeteer/chrome/linux-1056772/ folder is well present. Only downgrading puppeteer does the trick, it seems very specific to how render spin up Linux and makes an image of the build because it works fine with docker files (https://github.com/gRoussac/evaluator/tree/master/docker)

Probably the same issue as https://github.com/puppeteer/puppeteer/issues/9190