Use Google Chrome Puppeteer

4.6k views Asked by At

I'm on Debian 8.7.1.

I want to use Google Chrome Puppeteer.

I have a file named script.js, and I put the getting screenshot commands as recommended in the Puppeteer documentation.

For running the JavaScript file, I run the following command:

nodejs script.js

But it has some errors:

(node:929) UnhandledPromiseRejectionWarning: Unhandled promise rejection   (rejection id: 2): AssertionError [ERR_ASSERTION]: Chromium  revision is not downloaded. Run "npm install"

(node:929) [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.

nodejs -v is v8.4.0 and npm -v is 5.3.0.

Please help me to solve this problem.

4

There are 4 answers

3
LLL On

Try disable your proxy. Worked for me.

2
ooops On

From error info:

Chromium revision is not downloaded. Run "npm install"

cd /path/to/puppeteer && npm install

this command will download chromium to /path/to/project/node_modules/puppeteer/.local-chromium/

0
docta_faustus On

Uninstalling and reinstalling Puppeteer removed this error for me. I believe it was caused from upgrading to a later version of Node and then downgrading again.

1
Jeff Kymer On
sudo npm install -g puppeteer --unsafe-perm=true --allow-root

worked!