Skip to content
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

Error: Chromium revision is not downloaded. Run "npm install" or "yarn install" #5403

Closed
GWevroy opened this issue Feb 9, 2020 · 8 comments

Comments

@GWevroy
Copy link

GWevroy commented Feb 9, 2020

Steps to reproduce

Tell us about your environment:

  • Puppeteer version:
  • Platform / OS version:
  • URLs (if applicable):
  • Node.js version:

What steps will reproduce the problem?

Please include code that reproduces the issue.

What is the expected result?

What happens instead?

@GWevroy
Copy link
Author

GWevroy commented Feb 9, 2020

Hi, I see this error has been reported before (but closed). I am having the same error. I am using Markdown in VS Code on Linux 18.04. When I click in the preview window and select Chrome (Puppeteer) -> PDF, I get told "Error: Chromium revision is not downloaded. Run "npm install" or "yarn install"

I have tried the suggestions in the earlier posting regarding this problem, but it doesn't help. Chromium is installed (version 79.0.3945.130) and I see the version number (though it's a different number with no decimal points) in the Node Modules .json file.

Sorry, I don't see where/how to view version info of either Puppeteer or Node.js. They are all latest installations though (as of the last few days). I know Puppeteer is installed as I can see the folder on my system, as well as the node modules (tried editing the launcher.js file as instructed on another forum page, to include the executable path for Chromium, but no luck either)

Any ideas?

@CluEleSsUK
Copy link

CluEleSsUK commented Feb 25, 2020

Also getting a similar error on Puppeteer 2.1.1:

Browser is not downloaded. Run \"npm install\" or \"yarn install\""

I'm running inside a docker container (node:10-slim) on an OSX host and have tried both installing chromium manually (using npm install chromium) and downloading google-chrome-stable_current_amd64 as well as the necessary dependencies (I was getting a different error pre-dependencies)

@CluEleSsUK
Copy link

CluEleSsUK commented Feb 25, 2020

As an update to my woes - because my Dockerfile build was running on a mac, but the image itself was running alpine, the RUN npm install task was pulling the mac version of chromium, and the alpine container was then not finding it.
I mitigated this by installing chromium manually into my image, and telling puppeteer not to download a chromium like so:

RUN apk add -U --no-cache --allow-untrusted udev ttf-freefont chromium git
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROMIUM_PATH /usr/bin/chromium-browser

and updated my usage of puppeteer as follows:

await puppeteer.launch({
    headless: true,
    executablePath: process.env.CHROMIUM_PATH,
    args: ['--no-sandbox'],
  })

Sorry if this is slightly off-topic, but it might help someone!

@aruprakshit
Copy link

@CluEleSsUK Are you using puppeteer or puppeteer-core? I installed:

 "dependencies": {
    "chrome-aws-lambda": "^1.11.1",
    "express": "^4.17.1",
    "puppeteer-core": "^1.11.0"
  },

I am having the same issue as this ticket has in subject.

@ethans333
Copy link

Did anyone solve this issue?

@Manoj-nathwani
Copy link

Looks like I managed to fix this!

Check out the official puppeteer <> docker docs:

https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md#running-puppeteer-in-docker

Example project

Dockerfile

FROM node:12-slim

RUN apt-get update \
    && apt-get install -y wget gnupg \
    && wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
    && sh -c 'echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list' \
    && apt-get update \
    && apt-get install -y google-chrome-stable libxss1 \
      --no-install-recommends \
    && rm -rf /var/lib/apt/lists/*

ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD true
ENV CHROMIUM_PATH google-chrome-stable

ADD package.json package-lock.json /
RUN npm install

# configure puppeteer user
RUN groupadd -r pptruser && useradd -r -g pptruser -G audio,video pptruser \
    && mkdir -p /home/pptruser/Downloads \
    && chown -R pptruser:pptruser /home/pptruser \
    && chown -R pptruser:pptruser /node_modules
USER pptruser

COPY . /app
WORKDIR /app

CMD ["npm", "start"]

package.json

{
    "name": "Sample Project",
    "version": "1.0.0",
    "scripts": {
        "start": "node main.js"
    },
    "dependencies": {
        "puppeteer": "^5.3.0",
    }
}

main.js

const puppeteer = require('puppeteer');
(async () => {
    const browser = await puppeteer.launch({
	  executablePath: process.env.CHROMIUM_PATH,
	  args: ['--no-sandbox'],
  });
  const page = await browser.newPage();
  await page.goto('https://www.google.com');
  // other actions...
  await browser.close();
})();

@stale
Copy link

stale bot commented Jun 25, 2022

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.

@stale stale bot added the unconfirmed label Jun 25, 2022
@stale
Copy link

stale bot commented Jul 25, 2022

We are closing this issue. If the issue still persists in the latest version of Puppeteer, please reopen the issue and update the description. We will try our best to accomodate it!

@stale stale bot closed this as completed Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants