본문 바로가기
카테고리 없음

puppeteer

by heybrro 2020. 12. 28.

npm install puppeteer시 오류나는 경우

> puppeteer@5.5.0 install C:\workspace\crawl\node_modules\puppeteer > node install.js ERROR: Failed to set up Chromium r818858! Set "PUPPETEER_SKIP_DOWNLOAD" env variable to skip download. Error: self signed certificate in certificate chain at TLSSocket.onConnectSecure (_tls_wrap.js:1502:34) at TLSSocket.emit (events.js:314:20) at TLSSocket._finishInit (_tls_wrap.js:937:8) at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:711:12) { code: 'SELF_SIGNED_CERT_IN_CHAIN' } npm WARN enoent ENOENT: no such file or directory, open 'C:\workspace\crawl\package.json' npm WARN crawl No description npm WARN crawl No repository field. npm WARN crawl No README data npm WARN crawl No license field. npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! puppeteer@5.5.0 install: `node install.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the puppeteer@5.5.0 install script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\( 이하생략)

npm install puppeteer --ignore-scripts

 

더보기

the problem may be caused by your internet can't download the newest Chromium,so you can use
npm install puppeteer --ignore-scripts to skip download

and then,when you use the script ,you should set the executablePath like

const path = require('path'); // the browser path const path = path.resolve('C:\Program Files\Google\Chrome\Application\chrome.exe') const browser = await puppeteer.launch({ executablePath: path })

댓글