question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

An error occurs when installing Puppeteer v3.0.0 on Cloud Build.

See original GitHub issue

Steps to reproduce

Tell us about your environment:

What steps will reproduce the problem?

Please include code that reproduces the issue.

Include the following files in your project and execute the build with Cloud Build.

cloudbuild.yaml

steps:
- name: 'gcr.io/cloud-builders/npm:current'
  args: ['ci']
  dir: 'functions/autodeploy'

Cloud Build log

Step #0: gcr.io/cloud-builders/npm:current
Step #0: 
Step #0: > puppeteer@3.0.0 install /workspace/node_modules/puppeteer
Step #0: > node install.js
Step #0: 
Step #0: (node:28) ExperimentalWarning: The fs.promises API is experimental
Step #0: 
Step #0: ERROR: Failed to set up Chromium r737027! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download.
Step #0: { Error: ENOENT: no such file or directory, chmod '/workspace/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome'
Step #0:   -- ASYNC --
Step #0:     at BrowserFetcher.<anonymous> (/workspace/node_modules/puppeteer/lib/helper.js:105:23)
Step #0:     at fetchBinary (/workspace/node_modules/puppeteer/install.js:150:27)
Step #0:     at download (/workspace/node_modules/puppeteer/install.js:78:9)
Step #0:   errno: -2,
Step #0:   code: 'ENOENT',
Step #0:   syscall: 'chmod',
Step #0:   path:
Step #0:    '/workspace/node_modules/puppeteer/.local-chromium/linux-737027/chrome-linux/chrome' }
Step #0: npm ERR! code ELIFECYCLE
Step #0: npm ERR! errno 1
Step #0: npm ERR! puppeteer@3.0.0 install: `node install.js`
Step #0: npm ERR! Exit status 1
Step #0: npm ERR! 
Step #0: npm ERR! Failed at the puppeteer@3.0.0 install script.
Step #0: npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
Step #0: 
Step #0: npm ERR! A complete log of this run can be found in:
Step #0: npm ERR!     /builder/home/.npm/_logs/2020-04-16T11_43_17_460Z-debug.log
Finished Step #0
ERROR
ERROR: build step 0 "gcr.io/cloud-builders/npm:current" failed: step exited with non-zero status: 1

What is the expected result?

Expect a successful installation.

What happens instead?

An error occurred while installing Puppeteer. There was no problem until version 2.1.1. When deploying directly to Google Cloud Functions, launch () resulted in an error.

I am not good at English, so I am using the help of Google Translate.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:18

github_iconTop GitHub Comments

25reactions
ykesslercommented, Jun 9, 2020

For @alanlonglong and anyone else getting permission denied errors…

ERROR: Failed to download Chromium r722234! Set “PUPPETEER_SKIP_CHROMIUM_DOWNLOAD” env variable to skip download. Error: EACCES: permission denied, mkdir ‘/usr/bin/node/lib/node_modules/puppeteer/.local-chromium’

Using --unsafe-perm flag worked for me

sudo npm install puppeteer --unsafe-perm

SEE: https://stackoverflow.com/a/51711889/165673

14reactions
textareacommented, Jun 22, 2020

Same issue on macOS @qrusadorz

Read more comments on GitHub >

github_iconTop Results From Across the Web

Troubleshooting - Puppeteer
The most common cause is a bug in Node.js v14.0.0 which broke extract-zip , the module Puppeteer uses to extract browser downloads into...
Read more >
Puppeteer Error: Failed to launch the browser process when ...
You need to downgrade your puppeteer version to 2.0.0, it's looks like if there is something which make failed puppeteer when you deploy ......
Read more >
Runtime versions using Node.js and Puppeteer
When using syn-nodejs-puppeteer-3.0 runtime version, make sure that your canary script is compatible with Node.js 12.x. If you use an earlier version of...
Read more >
Karma Unit Tests not able to run in Google Cloud Build with ...
However I can't launch ChromeHeadless and get the following error. 03 07 2019 03:19:25.066:INFO [karma-server]: Karma v4.1.0 server started at ...
Read more >
This version has been deprecated - puppeteer - npm
0+. Starting from v3.0.0 Puppeteer starts to rely on Node 10.18.1+. All examples below use async/await which is only supported in Node v7 ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found