puppeteer: raspberry pi Chromium revision is not downloaded
Hi
i use raspbian stretch and i install puppeteer with npm but it did not download chromium
the os has the latest chromium
chromium-browser is already the newest version (60.0.3112.89-0ubuntu0.14.04.1.1010).
but when i run codes i have get error
(node:4035) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): AssertionError [ERR_ASSERTION]: Chromium revision is not downloaded. Run "npm install" (node:4035) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
i also test npm install as it says but not working
what should i do?
About this issue
- Original URL
- State: closed
- Created 7 years ago
- Reactions: 33
- Comments: 85 (7 by maintainers)
Fresh update to this issue for those doing a fresh install:
sudo apt install chromium-browser chromium-codecs-ffmpeg
puppeteer-core@v1.11.0
“stable” is the one that works with chromium-browser version 65const puppeteer = require('puppeteer-core');
const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
I have no trouble with the extra args that were suggested earlier (disable sandbox, gpu, etc) but I found that it works either way now. So just “executablePath” should do it.
The other thing I did was install the packages on the troubleshooting page: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md where you can “sudo apt install” the packages listed under “Debian (e.g. Ubuntu) Dependencies”. Here is the current version if you just want to copy-and-paste.
sudo apt install gconf-service libasound2 libatk1.0-0 libatk-bridge2.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 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
@torinnguyen and others using Raspberry Pi and trying to get screen captures or make pdfs here is what I was able to make work. The issue is the version provided by the latest version from Debian Stretch is 63.0.x which is outdated compared to where this library currently is. So the solution is to manually update the Pi’s version of Chromium so it will work with the latest version of this library. The version downloaded into the node_modules library will not work due to it not having support for Arm (as previously mentioned in other comments and issues). As of puppeteer v1.0.0 you will get ELF errors when trying to launch that version.
First step is to look at the release notes and see what version of chrome is supported for the release of this library. For version 1.0.0 the supported Chromium version is 65. For version 0.13.0 the supported version is 64 and so on down. Check the releases for the versions supported.
Next step is to find the version of Chromium for your Pi that is newer than the stable 63, which is not exactly straight forward. I have only tested downloading the files directly from the chromium-team site on launchpad and installing them. They also have instructions on how to add the PPA to your system but I have not ventured that far yet. As of right now if you want to use the latest version 65 (v1.0.0) you will need to go to the “dev” section. The “beta” section is Chrome 64 (v0.12.0) and stable is 63 (v0.11.0) which you should have if you have updated your version of debian. When you go to the section you want you will need to click on View package details, This will give you a list of the different ubuntu versions available. Click on the one you want (I used 14 for my testing) and then scroll down to the link for armhf and click it. This will give you all the files available for that version of ubuntu and Chromium that will run on the Pi.
For which ever version of Chromium you want to install the idea is the same just replace the example here with the files you downloaded. Also you need to install the chromium-codecs-ffmpeg package first before trying to install the actual chromium-browser package. This example is for the dev version, Chromium 65. I used the ubuntu 14 (Trusty) versions and had no issues creating images or pdfs.
I used the following code in test.js (thanks @jindongh) to make sure the installed version would launch without issue, take a screen capture and save it as an image.
You just run it with
node test.js
and it should create a example.png file with a screen capture of example.com. If you see no errors check the example.png and there should be an image of the web page. If so then that version of puppeteer is working properly.If anyone tests out the PPA installed version please let me/us know how it goes and if it is a better solution. I did not want to do it to prevent future “dev” updates from chromium breaking something in production. My production version is still using the stable version 63 of the chromium-l10n library that comes from debian. It seems like the version doesn’t matter too much as the browser launches fine but it would be nice to get an updated version of that library to match the installed version.
Edit: Changed to ubuntu 14 (Trusty) as that is the normal version used for my PI & typo in deb command.
I don’t know how these comments are not linked here:
@ablears:
@ibrcic:
I wrote this short article explaining how to tackle the problem for the moment:
https://code-flow-hjbello.blogspot.com/2018/11/make-puppeteer-work-with-raspbian-vers.html
It combines various of the answers given here and works for me.
Carefull when you download and install chrome 65 and its codes, some links above do not work any more, the right ones are:
wget http://launchpadlibrarian.net/361669485/chromium-browser_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb; sudo dpkg -i chromium-browser_65.0.3325.181-0ubuntu0.14.04.1_armhf.deb
wget http://launchpadlibrarian.net/361689926/chromium-codecs-ffmpeg_65.0.3325.181-0ubuntu0.16.04.1_armhf.deb; sudo dpkg -i chromium-codecs-ffmpeg_65.0.3325.181-0ubuntu0.16.04.1_armhf.deb
@jindongh comment works, but only with puppeteer v0.10.0
This init code works:
const browser = await puppeteer.launch({args: ['--no-sandbox', '--disable-setuid-sandbox', '--headless', '--disable-gpu'], executablePath: '/usr/bin/chromium-browser'});
Here’s the list of configs I have tried on Raspberry Pipuppeteer v0.10.0, /usr/bin/chromium-browser -> works puppeteer v0.12.0, /usr/bin/chromium-browser -> NOT working, freeze at newPage puppeteer v0.13.0, /usr/bin/chromium-browser -> NOT working, freeze at newPage
puppeteer v0.10.0, chrome in /node-modules -> NOT working, Error: Failed to launch chrome! puppeteer v0.12.0, chrome in /node-modules -> NOT working, Error: Failed to launch chrome! puppeteer v0.13.0, chrome in /node-modules -> NOT working, Error: Failed to launch chrome! (all Debian dependencies are installed)
node v8.9.1 chromium-browser_62 (downloaded with @jindongh comment) Linux raspberrypi 4.9.41-v7+ #1023 SMP Tue Aug 8 16:00:15 BST 2017 armv7l GNU/Linux
Yesterday, I successfully run latest puppeteer on Raspbian. Let me go through all steps that I tried:
Thanks a lot!
I build Chromium for arm using recipe 2 from here.
Before start I have Chromium checkout for regular Linux build, I added target_cpu = “arm” to gn flags, run following code and build using ninja.
./build/linux/sysroot_scripts/install-sysroot.py --arch=arm
I don’t have any estimations when we’ll get arm build support as part of npm install but we have it in our list.
Ok. It’s temporary solution, I hope that we’ll make it more fancy soon. By following link you can download chromium required for puppeteer in headless mode, download it, upload to raspberry pi, unpack it, install required dependency and run one of the puppeteer example to check that it works and please share your feedback!
For anyone here working on
Raspbery Pi Zero
, the above instructions will not work because thechromium-team
arm binary is for armv7, which the pi 3 has (not previous versions).After trying all night, all I could get was:
The solution is just to use the chromium browser in the default repositories (version 65 on stretch raspian).
I tried to make a patch for utils/ChromiumDownloader.js but seems like there are no arm64 snapshots and it doesn’t worth to only support 32bit arm 😕 so my suggestion @saghul is to use
browser.launch({executablePath: 'chromium'})
and set the env flagPUPPETEER_SKIP_CHROMIUM_DOWNLOAD
You can run it inside a docker container on raspberrypi to fix the issue if you want to know more about this just reply and I’ll develop
This worked for me (updated @Austinb with the now beta channel):
On OSX I solved the problem doing the following:
brew install -g puppeteer
, which downloaded the specific compatible version of Chromium on~/.npm-packages/lib/node_modules/puppeteer/.local-chromium/mac-508693/chrome-mac/Chromium.app/Contents/MacOS/Chromium
, I then setCHROME_BIN='.npm-packages/lib/node_modules/puppeteer/.local-chromium/mac-508693/chrome-mac/Chromium.app/Contents/MacOS/Chromium'
on my~/.bashrc
and it worked!
I found that in raspbian stretch , chromium version 60 is preinstalled and chromium-headless works with command line
chromium-browser --headless --disable-gpu --print-to-pdf https://www.google.com
how could i use built in chromium for puppeteer? @ak239 @silverwindFYI - I came up with a solution that seems to work for me with the existing chromium build. Instead of running with the --headless option, I start an Xvfb display, then point chromium to that with --display=:1
This effectively runs headless anyway, but avoids the issues with using the --headless flag. Everything appears to be working as expected now.
Xvfb :1 -screen 0 1920x1080x24 &
Puppeteer call to launch Chromium is now:
puppeteer.launch({defaultViewport: {height: 1080, width: 1920}, headless: false, args: ['--display=:1', '--no-sandbox', '--disable-extensions'], executablePath: '/usr/bin/chromium-browser'});
Raspbian 9.4 stretch, armv7l Linux 4.14.71-v7+ puppeteer: 1.9.0 chromium-browser_71.0.3554.0-0ubuntu0.16.04.1_armhf.deb
For first time Chromium didn’t find some deps. After
sudo apt-get --fix-broken install
run and browser reinstall, my puppeteer scripts start working withexecutablePath
changed.update. new links for chromium 71, working with 1.9.0
Since this issue has gotten some action in the last week it appears that 65 maybe the last version for the 14.x series. Version 66 is available in the beta for 16 and 17 now so its possible if you are running 14 you may run into compatibility issues until the PI’s version is updated to the 16 LTS base. You maybe able to use the non Ubuntu specific version like
67.0.3381.0-0ubuntu2
but I have not tested it.I still have not tested using the PPA so that your version is updated without having to find the files. Beware this may break your system!
There is also a I10n library available for 65 which should probably be installed as well if you have language issues with the 63 version installed by default.
Hi I’m getting the same issue but with prerender-spa-plugin, I couldn’t find where it’s using puppeteer so can’t replace const browser like this
const browser = await puppeteer.launch({executablePath: '/usr/bin/chromium-browser'});
any idea how I can fix it in my case? 😦 much appreaciated!This worked for me on my Raspberry PI B+.
First, I removed the old chromium pre-installed, and then installed it again (just in case). No idea if dependencies are needed as I tried different solutions before this, and may have them pre-installed before doing this)
Then created a brand new folder
Then set “PUPPETEER_SKIP_CHROMIUM_DOWNLOAD” to true:
Then installed puppeteer:
Then checked that puppeteer didn’t install any browser (there shouldn’t be any “.local-chromium” or anything like that):
Then created a new example.js file to test if it works. Copied the code quoted above:
Then run it
If no errors, you should see no console messages here
Finally to check, do
And you should see a file called “example.png” that is a screenshot of the web above “https://example.com”
For the benefit of others that may arrive here looking for answers…
Upgraded Raspberry Pi 3 to
stretch
. That installed this version ofchromium-browser
:Using
puppeteer@1.5.0
, this version ofchromium-browser
works for my use case (fast-cli@2.2.0
). I did modifypuppeteer.launch
arguments per https://github.com/GoogleChrome/puppeteer/issues/550#issuecomment-349497339.@napolux instead of using the default chromium v63 that comes with raspbian stretch, use v65 and you should be good to go for now.