Replies: 12 comments 22 replies
-
I faced the same problem upgrading, tried to set Chrome path manually but none seemed to worked out so reverted it back and use older version of puppeteer right now, will try again later on |
Beta Was this translation helpful? Give feedback.
-
Puppeteer 19 moved the directory the Chrome binary gets stored in. The Browsershot requirements installation instructions will need to be updated. Oddly, however, I've found that even in version 18, You can either fiddle with the
Should get you up and running again. |
Beta Was this translation helpful? Give feedback.
-
I was unable to get this working using the forge install instructions. Specifically, the issue was on the last command: $ sudo chmod -R o+rx /usr/lib/node_modules/puppeteer/.local-chromium
> chmod: cannot access '/usr/lib/node_modules/puppeteer/.local-chromium': No such file or directory My workaround was to install puppeteer & chromium globally. Puppeteer via NPM and chromium via apt-get. $ sudo npm install -g puppeteer
$ sudo apt-get install chromium-browser Then in Browsershot, specify the chromium bin. You can use Browsershot::url('https://google.com')
->setChromePath('/snap/bin/chromium')
->bodyHtml() I tried a few other things prior to this including:
|
Beta Was this translation helpful? Give feedback.
-
Another way I found to make it work with Puppeteer 20.x when installed globally, if you want a more fixed Chromium install than installing it via apt-get:
You should see some output that it's downloading Chrome.
|
Beta Was this translation helpful? Give feedback.
-
@ethanclevenger91 solution worked fine for me too on recently provisioned forge server. @freekmurze I've created a pull request #777 to update the docs |
Beta Was this translation helpful? Give feedback.
-
Puppeteer is up to v21 now. Are we forever constrained to v17 or does anyone know a solution to use updated versions? I've tried |
Beta Was this translation helpful? Give feedback.
-
the problem is: puppeteer is installed as root, so the browser is located in/root/ and not accessible with the forge user skip install dependencies für chrome: now install puppeteer as forge user if you are using ci/vite/other node stuff, add puppeteer in your package.json and use "npm ci" in your deployment script. don't remove the node modules :) that is all. someone should update the documentation |
Beta Was this translation helpful? Give feedback.
-
Did anyone able to make it work, for the past year that is the fourth time I'm trying to update Puppeteer, but each time I have to downgrade it again. It's working on Laravel sail, but on production on Runcloud it's giving errors. |
Beta Was this translation helpful? Give feedback.
-
I just installed this and thought I'd share what worked for me: curl -sL https://deb.nodesource.com/setup_22.x | sudo -E bash - # pick your nodejs version here, I chose v22 as it's the current
sudo apt-get install -y nodejs gconf-service libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 libnss3 lsb-release xdg-utils wget libgbm-dev libxshmfence-dev
sudo npm install --location=global --unsafe-perm puppeteer
npx puppeteer browsers install chrome This allowed me to install the latest version of Puppeteer (v22.6.5) and Chrome (v123.0.6312.122) on a typical Forge setup. |
Beta Was this translation helpful? Give feedback.
-
If you want to use it on Vagrant with Homestead
And then, in PHP:
it works with |
Beta Was this translation helpful? Give feedback.
-
My app runs on an ARM server in production. Does anyone have steps to get it working there? I've installed Chromium instead of Chrome. |
Beta Was this translation helpful? Give feedback.
-
Here's my experience using a Livewire app hosted on Fly.io. I'm not sure if it's the best method, but it works for now; I might update this approach later. I've tried all the other methods mentioned, but none were successful for me. # Install node in fly-laravel image
RUN curl -sL https://deb.nodesource.com/setup_20.x -o nodesource_setup.sh \
&& bash nodesource_setup.sh \
&& apt install -y nodejs \
&& npm install --location=global --unsafe-perm puppeteer
# Set environment for Puppeteer
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome
# Install dependencies for Chrome/Chromium
RUN apt-get install -y \
wget \
gnupg \
ca-certificates \
libxss1 \
libgconf-2-4 \
libasound2 \
libatk1.0-0 \
libatk-bridge2.0-0 \
libgdk-pixbuf2.0-0 \
libgtk-3-0 \
libnspr4 \
libnss3 \
libx11-xcb1 \
libxcomposite1 \
libxcursor1 \
libxdamage1 \
libxi6 \
libxtst6
# Install Google Chrome
RUN wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | apt-key add - \
&& echo "deb [arch=amd64] http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list \
&& apt-get update -y \
&& apt-get install -y google-chrome-stable \
&& rm -rf /var/lib/apt/lists/* |
Beta Was this translation helpful? Give feedback.
-
Puppeteer 19 downloads Chromium into a .cache folder, previously it stored it within it's own node_modules folder. For some reason Browsershot won't work anymore with this, I get the error 'Could not find expected browser locally'.
Beta Was this translation helpful? Give feedback.
All reactions