admin管理员组文章数量:1332389
const browser = await puppeteer.launch({
executablePath: process.env.PUPPETEER_EXECUTABLE_PATH,
args: ['--no-sandbox', '--disable-setuid-sandbox'],
});
const page = await browser.newPage();
I'm using this in a NestJs service, I have configured PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium-browser in AWS configuration and I have an error: Failed to generate PDF: Browser was not found at the configured executablePath (/usr/bin/chromium-browser). The build is done through a gitlab pipeline in which I installed everything (i hope):
- echo "Starting image provisioning... Installing prerequisites --> aws-cli, nodejs, npm"
# Install aws CLI, NodeJS and npm
- apk add --no-cache aws-cli nodejs npm
- apk update
- apk add --no-cache chromium nss freetype harfbuzz ca-certificates -ttf-freefont
- chromium --version
- which chromium-browser
which chromium-browser
gives the output: /usr/bin/chromium-browser
chromium --version gives the output: `Chromium 131.0.6778.85 Alpine Linu
x
I tried every solution I could found and still I have the same error as above mentioned. Tried with PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium-browser and PUPPETEER_EXECUTABLE_PATH: /usr/bin/chromium
Tried with headless: true on puppeteer.launch()
本文标签: NestJs Puppeteer doesn39t work on docker with Alpine Linux (in AWS)Stack Overflow
版权声明:本文标题:NestJs Puppeteer doesn't work on docker with Alpine Linux (in AWS) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742291691a2447919.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论