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

is:issue is:open When you install Puppeteer, it does not download a recent version of Chromium #6586

Closed
sharabiania opened this issue Nov 6, 2020 · 13 comments

Comments

@sharabiania
Copy link

sharabiania commented Nov 6, 2020

when installing Puppeteer using npm install puppeteer, it does not download a recent version of Chromium as it is mentioned in the documentation.

When using puppeteer.launch({product: 'chrome'}), I found out it is looking for this folder: node_modules/puppeteer/.local-chromium/mac-756035 which does not exist. And it does not attempt to download.

Notes:

  • I have not set the environment variable to skip the download. (also tried to setting it to false)
  • Tried puppeteer versions 5.0.0 and 5.4.1
  • I'm using a mac

In version 5.0.0 I get the following error:

Could not find browser revision 756035. Run "npm install" or "yarn install" to download a browser binary.

Where as in version 5.4.1 I get a different error:

Could not find browser revision 809590. Run "PUPPETEER_PRODUCT=firefox npm install" or
"PUPPETEER_PRODUCT=firefox yarn install" to download a supported Firefox browser binary.'

Which is even stranger cause I explicitly used product: 'chrome' in the launch options.

Error is at

const missingText = !fs.existsSync(executablePath)

cause the executablePath is something like: node_modules/puppeteer/.local-chromium/mac-756035 which does not exist.

const missingText = !revisionInfo.local

@vjnepse
Copy link

vjnepse commented Nov 6, 2020

I get the same error as you on Macos (Catalina) with version 5.4.1
I installed it by running:
npm install puppeteer-core

@swissspidy
Copy link

Are you using npm 6 or npm 7?

@vjnepse
Copy link

vjnepse commented Nov 11, 2020

I get the same error as you on Macos (Catalina) with version 5.4.1
I installed it by running:
npm install puppeteer-core

Instead of trying to find out how to use the installed chrome, I just did an npm remove and then installed puppeteer (non-core) instead. Problem fixed.

@sharabiania
Copy link
Author

@swissspidy npm version 6.14.8

@mroderick
Copy link

I am able to reproduce this in a clean repository

npm@6

~/code/puppeteer-chromium-bug$ nvm use 14
Now using node v14.15.0 (npm v6.14.8)
~/code/puppeteer-chromium-bug$ rm -rf node_modules/
~/code/puppeteer-chromium-bug$ npm install puppeteer@latest --save-dev --verbose
npm info it worked if it ends with ok
npm verb cli [
npm verb cli   '/Users/morgan/.nvm/versions/node/v14.15.0/bin/node',
npm verb cli   '/Users/morgan/.nvm/versions/node/v14.15.0/bin/npm',
npm verb cli   'install',
npm verb cli   'puppeteer@latest',
npm verb cli   '--save-dev',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@6.14.8
npm info using node@v14.15.0
npm verb npm-session 765df3f2312d1120
npm http fetch GET 304 https://registry.npmjs.org/puppeteer 346ms (from cache)
npm timing stage:loadCurrentTree Completed in 419ms
npm timing stage:loadIdealTree:cloneCurrentTree Completed in 0ms
npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm timing stage:loadIdealTree:loadShrinkwrap Completed in 69ms
npm http fetch GET 304 https://registry.npmjs.org/https-proxy-agent 306ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-fs 440ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/rimraf 448ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/debug 467ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/unbzip2-stream 166ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/extract-zip 480ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/node-fetch 485ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/proxy-from-env 482ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/progress 501ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pkg-dir 504ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/devtools-protocol 515ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ws 186ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ms 66ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/yauzl 93ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/get-stream 96ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fyauzl 112ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/@types%2fnode 101ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pump 67ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/once 263ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/end-of-stream 264ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/wrappy 82ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fd-slicer 85ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer-crc32 87ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/pend 86ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/agent-base 152ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/find-up 77ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/locate-path 77ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/path-exists 94ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/p-locate 96ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/p-limit 293ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/p-try 116ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/glob 132ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/minimatch 135ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/path-is-absolute 137ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/inherits 140ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs.realpath 145ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/inflight 158ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/brace-expansion 75ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/balanced-match 81ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/concat-map 99ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/tar-stream 86ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/mkdirp-classic 91ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/chownr 93ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/readable-stream 110ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/fs-constants 116ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/bl 117ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/buffer 264ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/ieee754 93ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/base64-js 95ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/util-deprecate 92ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/string_decoder 95ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/safe-buffer 173ms (from cache)
npm http fetch GET 304 https://registry.npmjs.org/through 65ms (from cache)
npm timing stage:loadIdealTree:loadAllDepsIntoIdealTree Completed in 3953ms
npm timing stage:loadIdealTree Completed in 4061ms
npm timing stage:generateActionsToTake Completed in 27ms
npm verb correctMkdir /Users/morgan/.npm/_locks correctMkdir not in flight; initializing
npm verb lock using /Users/morgan/.npm/_locks/staging-04acb13b7411d6fe.lock for /Users/morgan/code/puppeteer-chromium-bug/node_modules/.staging
npm timing audit submit Completed in 426ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/audits/quick 425ms
npm timing audit body Completed in 3ms
npm timing action:extract Completed in 632ms
npm timing action:finalize Completed in 86ms
npm timing action:refresh-package-json Completed in 166ms
npm info lifecycle @types/node@14.14.19~preinstall: @types/node@14.14.19
npm info lifecycle @types/yauzl@2.9.1~preinstall: @types/yauzl@2.9.1
npm info lifecycle agent-base@5.1.1~preinstall: agent-base@5.1.1
npm info lifecycle balanced-match@1.0.0~preinstall: balanced-match@1.0.0
npm info lifecycle base64-js@1.5.1~preinstall: base64-js@1.5.1
npm info lifecycle buffer-crc32@0.2.13~preinstall: buffer-crc32@0.2.13
npm info lifecycle chownr@1.1.4~preinstall: chownr@1.1.4
npm info lifecycle concat-map@0.0.1~preinstall: concat-map@0.0.1
npm info lifecycle brace-expansion@1.1.11~preinstall: brace-expansion@1.1.11
npm info lifecycle fs-constants@1.0.0~preinstall: fs-constants@1.0.0
npm info lifecycle fs.realpath@1.0.0~preinstall: fs.realpath@1.0.0
npm info lifecycle ieee754@1.2.1~preinstall: ieee754@1.2.1
npm info lifecycle buffer@5.7.1~preinstall: buffer@5.7.1
npm info lifecycle inherits@2.0.4~preinstall: inherits@2.0.4
npm info lifecycle minimatch@3.0.4~preinstall: minimatch@3.0.4
npm info lifecycle mkdirp-classic@0.5.3~preinstall: mkdirp-classic@0.5.3
npm info lifecycle ms@2.1.2~preinstall: ms@2.1.2
npm info lifecycle debug@4.3.1~preinstall: debug@4.3.1
npm info lifecycle p-try@2.2.0~preinstall: p-try@2.2.0
npm info lifecycle p-limit@2.3.0~preinstall: p-limit@2.3.0
npm info lifecycle p-locate@4.1.0~preinstall: p-locate@4.1.0
npm info lifecycle locate-path@5.0.0~preinstall: locate-path@5.0.0
npm info lifecycle path-exists@4.0.0~preinstall: path-exists@4.0.0
npm info lifecycle find-up@4.1.0~preinstall: find-up@4.1.0
npm info lifecycle path-is-absolute@1.0.1~preinstall: path-is-absolute@1.0.1
npm info lifecycle pend@1.2.0~preinstall: pend@1.2.0
npm info lifecycle fd-slicer@1.1.0~preinstall: fd-slicer@1.1.0
npm info lifecycle safe-buffer@5.2.1~preinstall: safe-buffer@5.2.1
npm info lifecycle string_decoder@1.3.0~preinstall: string_decoder@1.3.0
npm info lifecycle through@2.3.8~preinstall: through@2.3.8
npm info lifecycle util-deprecate@1.0.2~preinstall: util-deprecate@1.0.2
npm info lifecycle readable-stream@3.6.0~preinstall: readable-stream@3.6.0
npm info lifecycle bl@4.0.3~preinstall: bl@4.0.3
npm info lifecycle wrappy@1.0.2~preinstall: wrappy@1.0.2
npm info lifecycle once@1.4.0~preinstall: once@1.4.0
npm info lifecycle end-of-stream@1.4.4~preinstall: end-of-stream@1.4.4
npm info lifecycle tar-stream@2.2.0~preinstall: tar-stream@2.2.0
npm info lifecycle inflight@1.0.6~preinstall: inflight@1.0.6
npm info lifecycle glob@7.1.6~preinstall: glob@7.1.6
npm info lifecycle pump@3.0.0~preinstall: pump@3.0.0
npm info lifecycle get-stream@5.2.0~preinstall: get-stream@5.2.0
npm info lifecycle yauzl@2.10.0~preinstall: yauzl@2.10.0
npm info lifecycle devtools-protocol@0.0.818844~preinstall: devtools-protocol@0.0.818844
npm info lifecycle extract-zip@2.0.1~preinstall: extract-zip@2.0.1
npm info lifecycle https-proxy-agent@4.0.0~preinstall: https-proxy-agent@4.0.0
npm info lifecycle node-fetch@2.6.1~preinstall: node-fetch@2.6.1
npm info lifecycle pkg-dir@4.2.0~preinstall: pkg-dir@4.2.0
npm info lifecycle progress@2.0.3~preinstall: progress@2.0.3
npm info lifecycle proxy-from-env@1.1.0~preinstall: proxy-from-env@1.1.0
npm info lifecycle rimraf@3.0.2~preinstall: rimraf@3.0.2
npm info lifecycle puppeteer@5.5.0~preinstall: puppeteer@5.5.0
npm info lifecycle ws@7.4.2~preinstall: ws@7.4.2
npm info lifecycle unbzip2-stream@1.4.3~preinstall: unbzip2-stream@1.4.3
npm info lifecycle tar-fs@2.1.1~preinstall: tar-fs@2.1.1
npm timing action:preinstall Completed in 19ms
npm info linkStuff @types/node@14.14.19
npm info linkStuff @types/yauzl@2.9.1
npm info linkStuff agent-base@5.1.1
npm info linkStuff balanced-match@1.0.0
npm info linkStuff base64-js@1.5.1
npm info linkStuff buffer-crc32@0.2.13
npm info linkStuff chownr@1.1.4
npm info linkStuff concat-map@0.0.1
npm info linkStuff brace-expansion@1.1.11
npm info linkStuff fs-constants@1.0.0
npm info linkStuff fs.realpath@1.0.0
npm info linkStuff ieee754@1.2.1
npm info linkStuff buffer@5.7.1
npm info linkStuff inherits@2.0.4
npm info linkStuff minimatch@3.0.4
npm info linkStuff mkdirp-classic@0.5.3
npm info linkStuff ms@2.1.2
npm info linkStuff debug@4.3.1
npm info linkStuff p-try@2.2.0
npm info linkStuff p-limit@2.3.0
npm info linkStuff p-locate@4.1.0
npm info linkStuff locate-path@5.0.0
npm info linkStuff path-exists@4.0.0
npm info linkStuff find-up@4.1.0
npm info linkStuff path-is-absolute@1.0.1
npm info linkStuff pend@1.2.0
npm info linkStuff fd-slicer@1.1.0
npm info linkStuff safe-buffer@5.2.1
npm info linkStuff string_decoder@1.3.0
npm info linkStuff through@2.3.8
npm info linkStuff util-deprecate@1.0.2
npm info linkStuff readable-stream@3.6.0
npm info linkStuff bl@4.0.3
npm info linkStuff wrappy@1.0.2
npm info linkStuff once@1.4.0
npm info linkStuff end-of-stream@1.4.4
npm info linkStuff tar-stream@2.2.0
npm info linkStuff inflight@1.0.6
npm info linkStuff glob@7.1.6
npm info linkStuff pump@3.0.0
npm info linkStuff get-stream@5.2.0
npm info linkStuff yauzl@2.10.0
npm info linkStuff devtools-protocol@0.0.818844
npm info linkStuff extract-zip@2.0.1
npm verb linkBins [
npm verb linkBins   { 'extract-zip': 'cli.js' },
npm verb linkBins   '/Users/morgan/code/puppeteer-chromium-bug/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff https-proxy-agent@4.0.0
npm info linkStuff node-fetch@2.6.1
npm info linkStuff pkg-dir@4.2.0
npm info linkStuff progress@2.0.3
npm info linkStuff proxy-from-env@1.1.0
npm info linkStuff rimraf@3.0.2
npm verb linkBins [
npm verb linkBins   { rimraf: 'bin.js' },
npm verb linkBins   '/Users/morgan/code/puppeteer-chromium-bug/node_modules/.bin',
npm verb linkBins   false
npm verb linkBins ]
npm info linkStuff tar-fs@2.1.1
npm info linkStuff unbzip2-stream@1.4.3
npm info linkStuff ws@7.4.2
npm info linkStuff puppeteer@5.5.0
npm timing action:build Completed in 31ms
npm info lifecycle @types/node@14.14.19~install: @types/node@14.14.19
npm info lifecycle @types/yauzl@2.9.1~install: @types/yauzl@2.9.1
npm info lifecycle agent-base@5.1.1~install: agent-base@5.1.1
npm info lifecycle balanced-match@1.0.0~install: balanced-match@1.0.0
npm info lifecycle base64-js@1.5.1~install: base64-js@1.5.1
npm info lifecycle buffer-crc32@0.2.13~install: buffer-crc32@0.2.13
npm info lifecycle chownr@1.1.4~install: chownr@1.1.4
npm info lifecycle concat-map@0.0.1~install: concat-map@0.0.1
npm info lifecycle brace-expansion@1.1.11~install: brace-expansion@1.1.11
npm info lifecycle fs-constants@1.0.0~install: fs-constants@1.0.0
npm info lifecycle fs.realpath@1.0.0~install: fs.realpath@1.0.0
npm info lifecycle ieee754@1.2.1~install: ieee754@1.2.1
npm info lifecycle buffer@5.7.1~install: buffer@5.7.1
npm info lifecycle inherits@2.0.4~install: inherits@2.0.4
npm info lifecycle minimatch@3.0.4~install: minimatch@3.0.4
npm info lifecycle mkdirp-classic@0.5.3~install: mkdirp-classic@0.5.3
npm info lifecycle ms@2.1.2~install: ms@2.1.2
npm info lifecycle debug@4.3.1~install: debug@4.3.1
npm info lifecycle p-try@2.2.0~install: p-try@2.2.0
npm info lifecycle p-limit@2.3.0~install: p-limit@2.3.0
npm info lifecycle p-locate@4.1.0~install: p-locate@4.1.0
npm info lifecycle locate-path@5.0.0~install: locate-path@5.0.0
npm info lifecycle path-exists@4.0.0~install: path-exists@4.0.0
npm info lifecycle find-up@4.1.0~install: find-up@4.1.0
npm info lifecycle path-is-absolute@1.0.1~install: path-is-absolute@1.0.1
npm info lifecycle pend@1.2.0~install: pend@1.2.0
npm info lifecycle fd-slicer@1.1.0~install: fd-slicer@1.1.0
npm info lifecycle safe-buffer@5.2.1~install: safe-buffer@5.2.1
npm info lifecycle string_decoder@1.3.0~install: string_decoder@1.3.0
npm info lifecycle through@2.3.8~install: through@2.3.8
npm info lifecycle util-deprecate@1.0.2~install: util-deprecate@1.0.2
npm info lifecycle readable-stream@3.6.0~install: readable-stream@3.6.0
npm info lifecycle bl@4.0.3~install: bl@4.0.3
npm info lifecycle wrappy@1.0.2~install: wrappy@1.0.2
npm info lifecycle once@1.4.0~install: once@1.4.0
npm info lifecycle end-of-stream@1.4.4~install: end-of-stream@1.4.4
npm info lifecycle tar-stream@2.2.0~install: tar-stream@2.2.0
npm info lifecycle inflight@1.0.6~install: inflight@1.0.6
npm info lifecycle glob@7.1.6~install: glob@7.1.6
npm info lifecycle pump@3.0.0~install: pump@3.0.0
npm info lifecycle get-stream@5.2.0~install: get-stream@5.2.0
npm info lifecycle yauzl@2.10.0~install: yauzl@2.10.0
npm info lifecycle devtools-protocol@0.0.818844~install: devtools-protocol@0.0.818844
npm info lifecycle extract-zip@2.0.1~install: extract-zip@2.0.1
npm info lifecycle https-proxy-agent@4.0.0~install: https-proxy-agent@4.0.0
npm info lifecycle node-fetch@2.6.1~install: node-fetch@2.6.1
npm info lifecycle pkg-dir@4.2.0~install: pkg-dir@4.2.0
npm info lifecycle progress@2.0.3~install: progress@2.0.3
npm info lifecycle proxy-from-env@1.1.0~install: proxy-from-env@1.1.0
npm info lifecycle rimraf@3.0.2~install: rimraf@3.0.2
npm info lifecycle tar-fs@2.1.1~install: tar-fs@2.1.1
npm info lifecycle unbzip2-stream@1.4.3~install: unbzip2-stream@1.4.3
npm info lifecycle ws@7.4.2~install: ws@7.4.2
npm info lifecycle puppeteer@5.5.0~install: puppeteer@5.5.0

> puppeteer@5.5.0 install /Users/morgan/code/puppeteer-chromium-bug/node_modules/puppeteer
> node install.js

Downloading Chromium r818858 - 132.4 Mb [====================] 100% 0.0s
Chromium (818858) downloaded to /Users/morgan/code/puppeteer-chromium-bug/node_modules/puppeteer/.local-chromium/mac-818858
npm verb lifecycle puppeteer@5.5.0~install: unsafe-perm in lifecycle true
npm verb lifecycle puppeteer@5.5.0~install: PATH: /Users/morgan/.nvm/versions/node/v14.15.0/lib/node_modules/npm/node_modules/npm-lifecycle/node-gyp-bin:/Users/morgan/code/puppeteer-chromium-bug/node_modules/puppeteer/node_modules/.bin:/Users/morgan/code/puppeteer-chromium-bug/node_modules/.bin:/Users/morgan/.pyenv/shims:/Users/morgan/.avn/bin:/Users/morgan/.nvm/versions/node/v14.15.0/bin:/Users/morgan/.rvm/gems/ruby-2.5.1/bin:/Users/morgan/.rvm/gems/ruby-2.5.1@global/bin:/Users/morgan/.rvm/rubies/ruby-2.5.1/bin:/Users/morgan/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/Library/Apple/usr/bin:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Users/morgan/.rvm/bin:/Users/morgan/.rvm/bin
npm verb lifecycle puppeteer@5.5.0~install: CWD: /Users/morgan/code/puppeteer-chromium-bug/node_modules/puppeteer
npm timing action:install Completed in 25183ms
npm info lifecycle @types/node@14.14.19~postinstall: @types/node@14.14.19
npm info lifecycle @types/yauzl@2.9.1~postinstall: @types/yauzl@2.9.1
npm info lifecycle agent-base@5.1.1~postinstall: agent-base@5.1.1
npm info lifecycle balanced-match@1.0.0~postinstall: balanced-match@1.0.0
npm info lifecycle base64-js@1.5.1~postinstall: base64-js@1.5.1
npm info lifecycle buffer-crc32@0.2.13~postinstall: buffer-crc32@0.2.13
npm info lifecycle chownr@1.1.4~postinstall: chownr@1.1.4
npm info lifecycle concat-map@0.0.1~postinstall: concat-map@0.0.1
npm info lifecycle brace-expansion@1.1.11~postinstall: brace-expansion@1.1.11
npm info lifecycle fs-constants@1.0.0~postinstall: fs-constants@1.0.0
npm info lifecycle fs.realpath@1.0.0~postinstall: fs.realpath@1.0.0
npm info lifecycle ieee754@1.2.1~postinstall: ieee754@1.2.1
npm info lifecycle buffer@5.7.1~postinstall: buffer@5.7.1
npm info lifecycle inherits@2.0.4~postinstall: inherits@2.0.4
npm info lifecycle minimatch@3.0.4~postinstall: minimatch@3.0.4
npm info lifecycle mkdirp-classic@0.5.3~postinstall: mkdirp-classic@0.5.3
npm info lifecycle ms@2.1.2~postinstall: ms@2.1.2
npm info lifecycle debug@4.3.1~postinstall: debug@4.3.1
npm info lifecycle p-try@2.2.0~postinstall: p-try@2.2.0
npm info lifecycle p-limit@2.3.0~postinstall: p-limit@2.3.0
npm info lifecycle p-locate@4.1.0~postinstall: p-locate@4.1.0
npm info lifecycle locate-path@5.0.0~postinstall: locate-path@5.0.0
npm info lifecycle path-exists@4.0.0~postinstall: path-exists@4.0.0
npm info lifecycle find-up@4.1.0~postinstall: find-up@4.1.0
npm info lifecycle path-is-absolute@1.0.1~postinstall: path-is-absolute@1.0.1
npm info lifecycle pend@1.2.0~postinstall: pend@1.2.0
npm info lifecycle fd-slicer@1.1.0~postinstall: fd-slicer@1.1.0
npm info lifecycle safe-buffer@5.2.1~postinstall: safe-buffer@5.2.1
npm info lifecycle string_decoder@1.3.0~postinstall: string_decoder@1.3.0
npm info lifecycle through@2.3.8~postinstall: through@2.3.8
npm info lifecycle util-deprecate@1.0.2~postinstall: util-deprecate@1.0.2
npm info lifecycle readable-stream@3.6.0~postinstall: readable-stream@3.6.0
npm info lifecycle bl@4.0.3~postinstall: bl@4.0.3
npm info lifecycle wrappy@1.0.2~postinstall: wrappy@1.0.2
npm info lifecycle once@1.4.0~postinstall: once@1.4.0
npm info lifecycle end-of-stream@1.4.4~postinstall: end-of-stream@1.4.4
npm info lifecycle tar-stream@2.2.0~postinstall: tar-stream@2.2.0
npm info lifecycle inflight@1.0.6~postinstall: inflight@1.0.6
npm info lifecycle glob@7.1.6~postinstall: glob@7.1.6
npm info lifecycle pump@3.0.0~postinstall: pump@3.0.0
npm info lifecycle get-stream@5.2.0~postinstall: get-stream@5.2.0
npm info lifecycle yauzl@2.10.0~postinstall: yauzl@2.10.0
npm info lifecycle devtools-protocol@0.0.818844~postinstall: devtools-protocol@0.0.818844
npm info lifecycle extract-zip@2.0.1~postinstall: extract-zip@2.0.1
npm info lifecycle https-proxy-agent@4.0.0~postinstall: https-proxy-agent@4.0.0
npm info lifecycle node-fetch@2.6.1~postinstall: node-fetch@2.6.1
npm info lifecycle pkg-dir@4.2.0~postinstall: pkg-dir@4.2.0
npm info lifecycle progress@2.0.3~postinstall: progress@2.0.3
npm info lifecycle proxy-from-env@1.1.0~postinstall: proxy-from-env@1.1.0
npm info lifecycle rimraf@3.0.2~postinstall: rimraf@3.0.2
npm info lifecycle tar-fs@2.1.1~postinstall: tar-fs@2.1.1
npm info lifecycle unbzip2-stream@1.4.3~postinstall: unbzip2-stream@1.4.3
npm info lifecycle ws@7.4.2~postinstall: ws@7.4.2
npm info lifecycle puppeteer@5.5.0~postinstall: puppeteer@5.5.0
npm timing action:postinstall Completed in 35ms
npm verb unlock done using /Users/morgan/.npm/_locks/staging-04acb13b7411d6fe.lock for /Users/morgan/code/puppeteer-chromium-bug/node_modules/.staging
npm timing stage:executeActions Completed in 26207ms
npm timing stage:rollbackFailedOptional Completed in 1ms
npm timing stage:runTopLevelLifecycles Completed in 30761ms
npm verb saving [ { name: 'puppeteer', spec: '^5.5.0', save: 'devDependencies' } ]
npm verb shrinkwrap skipping write for package.json because there were no changes.
npm info lifecycle undefined~preshrinkwrap: undefined
npm info lifecycle puppeteer-chromium-bug@1.0.0~shrinkwrap: puppeteer-chromium-bug@1.0.0
npm info lifecycle puppeteer-chromium-bug@1.0.0~postshrinkwrap: puppeteer-chromium-bug@1.0.0
npm WARN puppeteer-chromium-bug@1.0.0 No description
npm WARN puppeteer-chromium-bug@1.0.0 No repository field.

+ puppeteer@5.5.0
added 54 packages from 75 contributors and audited 54 packages in 30.891s

8 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

npm verb exit [ 0, true ]
npm timing npm Completed in 31306ms
npm info ok

Observe that Chromium is downloaded

npm@7.3.0

~/code/puppeteer-chromium-bug$ rm -rf node_modules/
~/code/puppeteer-chromium-bug$ nvm use 15
npm install puppeteer@latest --save-dev --verbose
npm verb cli [
npm verb cli   '/Users/morgan/.nvm/versions/node/v15.0.1/bin/node',
npm verb cli   '/Users/morgan/.nvm/versions/node/v15.0.1/bin/npm',
npm verb cli   'install',
npm verb cli   'puppeteer@latest',
npm verb cli   '--save-dev',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@7.3.0
npm info using node@v15.0.1
npm timing config:load:defaults Completed in 2ms
npm timing config:load:file:/Users/morgan/.nvm/versions/node/v15.0.1/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 4ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/Users/morgan/code/puppeteer-chromium-bug/.npmrc Completed in 3ms
npm timing config:load:project Completed in 3ms
npm timing config:load:file:/Users/morgan/.npmrc Completed in 1ms
npm timing config:load:user Completed in 1ms
npm timing config:load:file:/Users/morgan/.nvm/versions/node/v15.0.1/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:cafile Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:setUserAgent Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 16ms
npm verb npm-session 8d78f8746dd945b4
npm timing npm:load Completed in 28ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 73ms
npm timing arborist:ctor Completed in 0ms
npm http fetch GET 304 https://registry.npmjs.org/puppeteer 571ms (from cache)
npm timing idealTree:userRequests Completed in 586ms
npm http fetch GET 304 https://registry.npmjs.org/puppeteer 164ms (from cache)
npm timing idealTree:#root Completed in 176ms
npm timing idealTree:buildDeps Completed in 179ms
npm timing idealTree:fixDepFlags Completed in 3ms
npm timing idealTree Completed in 847ms
npm timing reify:loadTrees Completed in 847ms
npm timing reify:diffTrees Completed in 3ms
npm timing reify:retireShallow Completed in 0ms
npm timing reify:createSparse Completed in 0ms
npm timing reify:loadBundles Completed in 0ms
npm timing reify:unpack Completed in 0ms
npm timing reify:unretire Completed in 1ms
npm timing build:queue Completed in 0ms
npm timing build:deps Completed in 2ms
npm timing build Completed in 2ms
npm timing reify:build Completed in 2ms
npm timing reify:trash Completed in 0ms
npm timing reify:save Completed in 16ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 328ms
npm timing auditReport:getReport Completed in 329ms
npm timing auditReport:init Completed in 0ms
npm timing reify:audit Completed in 330ms
npm timing reify Completed in 1185ms

up to date, audited 55 packages in 1s

found 0 vulnerabilities
npm timing command:install Completed in 1190ms
npm verb exit 0
npm timing npm Completed in 1446ms
npm info ok
~/code/puppeteer-chromium-bug$ rm -rf node_modules/
~/code/puppeteer-chromium-bug$ npm install puppeteer@latest --save-dev --verbose
npm verb cli [
npm verb cli   '/Users/morgan/.nvm/versions/node/v15.0.1/bin/node',
npm verb cli   '/Users/morgan/.nvm/versions/node/v15.0.1/bin/npm',
npm verb cli   'install',
npm verb cli   'puppeteer@latest',
npm verb cli   '--save-dev',
npm verb cli   '--verbose'
npm verb cli ]
npm info using npm@7.3.0
npm info using node@v15.0.1
npm timing config:load:defaults Completed in 1ms
npm timing config:load:file:/Users/morgan/.nvm/versions/node/v15.0.1/lib/node_modules/npm/npmrc Completed in 1ms
npm timing config:load:builtin Completed in 1ms
npm timing config:load:cli Completed in 3ms
npm timing config:load:env Completed in 1ms
npm timing config:load:file:/Users/morgan/code/puppeteer-chromium-bug/.npmrc Completed in 0ms
npm timing config:load:project Completed in 0ms
npm timing config:load:file:/Users/morgan/.npmrc Completed in 5ms
npm timing config:load:user Completed in 6ms
npm timing config:load:file:/Users/morgan/.nvm/versions/node/v15.0.1/etc/npmrc Completed in 0ms
npm timing config:load:global Completed in 0ms
npm timing config:load:cafile Completed in 0ms
npm timing config:load:validate Completed in 0ms
npm timing config:load:setUserAgent Completed in 1ms
npm timing config:load:setEnvs Completed in 0ms
npm timing config:load Completed in 13ms
npm verb npm-session a9903fec9b9ec5b5
npm timing npm:load Completed in 27ms
npm timing arborist:ctor Completed in 1ms
npm timing idealTree:init Completed in 70ms
npm http fetch GET 304 https://registry.npmjs.org/puppeteer 351ms (from cache)
npm timing idealTree:userRequests Completed in 366ms
npm http fetch GET 304 https://registry.npmjs.org/puppeteer 258ms (from cache)
npm timing idealTree:#root Completed in 275ms
npm timing idealTree:buildDeps Completed in 281ms
npm timing idealTree:fixDepFlags Completed in 2ms
npm timing idealTree Completed in 725ms
npm timing reify:loadTrees Completed in 725ms
npm timing reify:diffTrees Completed in 2ms
npm timing reify:retireShallow Completed in 0ms
npm timing reify:createSparse Completed in 15ms
npm timing reify:loadBundles Completed in 0ms
npm timing reifyNode:node_modules/once Completed in 241ms
npm timing reifyNode:node_modules/path-is-absolute Completed in 243ms
npm timing reifyNode:node_modules/ms Completed in 242ms
npm timing reifyNode:node_modules/mkdirp-classic Completed in 242ms
npm timing reifyNode:node_modules/inflight Completed in 243ms
npm timing reifyNode:node_modules/wrappy Completed in 247ms
npm timing reifyNode:node_modules/buffer-crc32 Completed in 243ms
npm timing reifyNode:node_modules/chownr Completed in 243ms
npm timing reifyNode:node_modules/brace-expansion Completed in 244ms
npm timing reifyNode:node_modules/@types/yauzl Completed in 247ms
npm timing reifyNode:node_modules/end-of-stream Completed in 248ms
npm timing reifyNode:node_modules/pend Completed in 251ms
npm timing reifyNode:node_modules/pkg-dir Completed in 253ms
npm timing reifyNode:node_modules/p-try Completed in 253ms
npm timing reifyNode:node_modules/path-exists Completed in 253ms
npm timing reifyNode:node_modules/p-limit Completed in 254ms
npm timing reifyNode:node_modules/inherits Completed in 253ms
npm timing reifyNode:node_modules/p-locate Completed in 254ms
npm timing reifyNode:node_modules/find-up Completed in 253ms
npm timing reifyNode:node_modules/ieee754 Completed in 254ms
npm timing reifyNode:node_modules/fs-constants Completed in 255ms
npm timing reifyNode:node_modules/balanced-match Completed in 254ms
npm timing reifyNode:node_modules/util-deprecate Completed in 261ms
npm timing reifyNode:node_modules/locate-path Completed in 259ms
npm timing reifyNode:node_modules/string_decoder Completed in 262ms
npm timing reifyNode:node_modules/extract-zip Completed in 260ms
npm timing reifyNode:node_modules/minimatch Completed in 261ms
npm timing reifyNode:node_modules/base64-js Completed in 260ms
npm timing reifyNode:node_modules/fs.realpath Completed in 262ms
npm timing reifyNode:node_modules/pump Completed in 265ms
npm timing reifyNode:node_modules/get-stream Completed in 265ms
npm timing reifyNode:node_modules/safe-buffer Completed in 270ms
npm timing reifyNode:node_modules/rimraf Completed in 270ms
npm timing reifyNode:node_modules/yauzl Completed in 271ms
npm timing reifyNode:node_modules/progress Completed in 271ms
npm timing reifyNode:node_modules/concat-map Completed in 269ms
npm timing reifyNode:node_modules/debug Completed in 271ms
npm timing reifyNode:node_modules/tar-stream Completed in 276ms
npm timing reifyNode:node_modules/https-proxy-agent Completed in 275ms
npm timing reifyNode:node_modules/proxy-from-env Completed in 276ms
npm timing reifyNode:node_modules/fd-slicer Completed in 279ms
npm timing reifyNode:node_modules/glob Completed in 280ms
npm timing reifyNode:node_modules/agent-base Completed in 280ms
npm timing reifyNode:node_modules/buffer Completed in 284ms
npm timing reifyNode:node_modules/through Completed in 288ms
npm timing reifyNode:node_modules/bl Completed in 287ms
npm timing reifyNode:node_modules/unbzip2-stream Completed in 295ms
npm timing reifyNode:node_modules/node-fetch Completed in 296ms
npm timing reifyNode:node_modules/ws Completed in 309ms
npm timing reifyNode:node_modules/readable-stream Completed in 319ms
npm timing reifyNode:node_modules/tar-fs Completed in 321ms
npm timing reifyNode:node_modules/@types/node Completed in 360ms
npm http fetch POST 200 https://registry.npmjs.org/-/npm/v1/security/advisories/bulk 372ms
npm timing auditReport:getReport Completed in 374ms
npm timing auditReport:init Completed in 0ms
npm timing reify:audit Completed in 376ms
npm timing reifyNode:node_modules/devtools-protocol Completed in 393ms
npm timing reifyNode:node_modules/puppeteer Completed in 513ms
npm timing reify:unpack Completed in 514ms
npm timing reify:unretire Completed in 1ms
npm timing build:queue Completed in 3ms
npm timing build:link:node_modules/extract-zip Completed in 3ms
npm timing build:link:node_modules/rimraf Completed in 3ms
npm timing build:link Completed in 4ms
npm info run puppeteer@5.5.0 install node_modules/puppeteer node install.js
npm info run puppeteer@5.5.0 install { code: 0, signal: null }
npm timing build:run:install:node_modules/puppeteer Completed in 22713ms
npm timing build:run:install Completed in 22713ms
npm timing build:deps Completed in 22721ms
npm timing build Completed in 22723ms
npm timing reify:build Completed in 22723ms
npm timing reify:trash Completed in 1ms
npm timing reify:save Completed in 27ms
npm timing reify Completed in 24030ms

added 54 packages, and audited 55 packages in 24s

found 0 vulnerabilities
npm timing command:install Completed in 24037ms
npm verb exit 0
npm timing npm Completed in 24281ms
npm info ok

Observe that Chromium is not downloaded


This could be related to npm/cli#1905, which has been fixed in the version I used to reproduce the issue. Perhaps there's more to that bug than first described, or this could be an entirely unrelated incompatibility between puppeteer and npm@7.

mroderick added a commit to mroderick/sinon that referenced this issue Jan 4, 2021
Despite npm/cli#1905
being fixed for `npm@7.1.2`, there are still
issues with installing `puppeteer` using `npm@7`.

See puppeteer/puppeteer#6586 (comment)

Therefore, we're reverting the accidental schema
upgrade from 0d1e40b to
the previous version, and removing
`markdownlint-cli` once more.
mroderick added a commit to sinonjs/sinon that referenced this issue Jan 4, 2021
Despite npm/cli#1905
being fixed for `npm@7.1.2`, there are still
issues with installing `puppeteer` using `npm@7`.

See puppeteer/puppeteer#6586 (comment)

Therefore, we're reverting the accidental schema
upgrade from 0d1e40b to
the previous version, and removing
`markdownlint-cli` once more.
@sgalindo2388
Copy link

Was anyone able to figure how to solve this issue? I started getting this error today and I'm not sure what else I can do.

I've tried removing puppeteer and re-installing (7.1.0 & 8.0.0), using different versions of node (8.15.1, 10.16.3 & 14.16.0) and npm(6.9.0 & 7.7.6) and keep getting the error:

"Error: Could not find expected browser (chrome) locally. Run `npm install` to download the correct Chromium revision (848005).
                    at ChromeLauncher.launch (/usr/local/lib/node_modules/backstopjs/node_modules/puppeteer/lib/cjs/puppeteer/node/Launcher.js:80:27)
                    at async processScenarioView (/usr/local/lib/node_modules/backstopjs/core/util/runPuppet.js:63:19)"

I'm trying to run a Backstopjs(https://github.com/garris/BackstopJS - v5.3.0) test but it seems like puppeteer still can't find chrome.

Any help would really be appreaciated.

@cyclingzealot
Copy link

cyclingzealot commented Jun 2, 2021

Was anyone able to figure how to solve this issue?
Any help would really be appreaciated.

I haven't confirmed this fix yet (by reproducing bug & fix). But explicitly installing pupetteer at the command line caused chrome to be installed. CHROME_DEVEL_SANDBOX was set too

$  npm install puppeteer --unsafe-perm=true --allow-root

> puppeteer@10.0.0 install /var/www/xxx/releases/20210602042922/node_modules/puppeteer
> node install.js

Downloading Chromium r884014 - 138.7 Mb [====================] 99% 0.0s
Chromium (884014) downloaded to /var/www/xxx/releases/20210602042922/node_modules/puppeteer/.local-chromium/linux-884014
+ puppeteer@10.0.0
added 1 package from 1 contributor, removed 1 package, updated 2 packages and audited 64 packages in 13.225s

1 package is looking for funding
  run `npm fund` for details

found 0 vulnerabilities

$ printenv
[...]
CHROME_DEVEL_SANDBOX=/usr/local/sbin/chrome-devel-sandbox


Running npm version 6.13.4:

$ npm -v
6.13.4

I'll certainly come back and reply / edit if I find out I can't reproduce this fix.

@Krinkle
Copy link

Krinkle commented Oct 15, 2021

This is still reproducible for me on npm 7.21.0 and puppeteer 7.0.0.

https://gist.github.com/Krinkle/71cbde9617a91154bf3fe1fa46f827a1/496acbed77dda58a1522f89496881ada28e0325b#file-puppeteer-issue-6586-log-L933-L934

$ npm --version
7.21.0

$ npm install fresnel@1.1.0
…
… puppeteer@7.0.0
…

$ ls -aF node_modules/fresnel/node_modules/puppeteer
./  ../  CHANGELOG.md  LICENSE	README.md  cjs-entry-core.js  cjs-entry.js  install.js	lib/  package.json  typescript-if-required.js

# no .local-chromium

May be related:

@rmschindler
Copy link

Indeed the instruction, "Run npm install to download the correct Chromium revision," does not download Chromium. I had to go to the node_modules/puppeteer directory and run node install.js. Anybody wise as to why npm wouldn't run that automatically?

@Krinkle
Copy link

Krinkle commented Nov 2, 2021

@rmschindler The problem is most likely that the package you are installing has a shrinkwrap that was generated with npm 6 or earlier.

The npm 7 release has been a mess of all kinds of poorly understood breaking changes, one of which being that postinstall scripts are completely ignored when a "v1" lockfile/shrinkwrap is at play. If there is no lock file, or if the lock file was generated with npm 7+, then it's all fine. It's rather annoying and unfortunate, but it is easy to fix once realized assuming you own the lockfile in question.

If the top-level package installed with npm install is not your own, and it uses a shrinkwrap in the package, then the maintainer of that package will need to release an update with an updated shrinkwrap.

Note that the puppeteer package itself does not have this problem, but you may be working on a project or using a package that uses a lockfile locally.

Also note that, while npm 7+ requires a v2/npm7+ lockfile in order to install puppeteer correctly, doing so does not break compatibility with npm 6 so this should be an uncontroversial thing to change in any project or package. That is, if you update your lock file with npm 7+ to the v2 lock format, it will still work correctly with npm 6. And unlike the "backwards compatibility" that npm 7 provides for v1 lock files (which is broken, per this issue), the forwards-compatibility that npm 6 has for v2 lock files does actually work correctly in regards to postinstall scripts for Puppeteer.

hgwood added a commit to Zenika/sensei that referenced this issue Nov 19, 2021
This simplifies setup and avoids a recuring issue when running "npm install" in the main package would result in infinite looping of calling the postinstall script. It also makes sensei publisable to npm more easily.

Due to puppeteer/puppeteer#6586 (comment), chrome was not being downloaded when running npm install. I had to fork and patch decktape. Let's hope the patch is merged and released. See astefanutti/decktape#237. Otherwise we could publish the fork.
astefanutti pushed a commit to astefanutti/decktape that referenced this issue Nov 19, 2021
This upgrades npm-shrinkwrap.json to lockfile version 2, which is the format introduced by npm v7. This fixes chrome not being downloaded when installing decktape as a dependency in a project using npm v7+. See puppeteer/puppeteer#6586 (comment). The new format is backward compatible so users of npm v6 and lower should not be impacted.
hgwood added a commit to Zenika/sensei that referenced this issue Nov 22, 2021
This simplifies setup and avoids a recuring issue when running "npm install" in the main package would result in infinite looping of calling the postinstall script. It also makes sensei publishable to npm more easily.

The PDF part was originally split for the main package to avoid having to install Chrome twice when developing, often in cases where I wasn't even touching the PDF part. However, as mentioned by @patou, a better technique to do that is to run `npm install` with `PUPPETEER_SKIP_CHROMIUM_DOWNLOAD` defined.

This also downgrades puppeteer from 11.0.0 to 10.4.0 to align to the version used by decktape 3.3.0 and allow npm to dedupe puppeteer and reduce the number of Chrome installs to 1. It does work in contrary from what I said in #120.

Due to puppeteer/puppeteer#6586 (comment), chrome was not being downloaded when running npm install. I had to fork and patch decktape. See astefanutti/decktape#237. The patch has been merged but not release so for now package.json points to the master branch of decktape instead of release. This should be changed as soon as decktape has a new release.
@stale
Copy link

stale bot commented Jun 23, 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 23, 2022
@markcellus
Copy link

Confirmed this is also happening for me

@stale stale bot removed the unconfirmed label Jul 21, 2022
@OrKoN
Copy link
Collaborator

OrKoN commented Sep 5, 2022

We generally rely on npm to run the install scripts which download the binary: the install command is only able to download a single Chromium version so it's not possible for it to download an older version. Also, I am not able to reproduce this issue with the latest versions of things. I am going to mark this issue as closed and @markcellus as it seems it happened to you recently, would you mind opening a new issue with a repro repository and all details about your npm/node/OS versions?

@OrKoN OrKoN closed this as not planned Won't fix, can't repro, duplicate, stale Sep 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants