Skipping browser download. "PUPPETEER_SKIP_DOWNLOAD" environment variable wa

最简单的方法就是cd/node_moudle/puppeteer 然后npm run install即可.
千万不要设置环境变量
PUPPETEER_SKIP_DOWNLOAD=true npm install puppeteer
因为你设置了他会跳过,只需要进入puppeteer路径,进行安装就可以了.

再就是安装后可能会报错.需要安装几个包才可以使用.

1
/home/work/node_modules/puppeteer/.local-chromium/linux-856583/chrome-linux/chrome: error while loading shared libraries: libatk-1.0.so.0: cannot open shared object file: No such file or directory

解决:yum install atk

1
chrome: error while loading shared libraries: libatk-bridge-2.0.so.0: cannot open shared object file: No such file or directory`

解决:yum install at-spi2-atk

1
chrome: error while loading shared libraries: libxkbcommon.so.0: cannot open shared object file: No such file or directory

解决:yum install libxkbcommon-x11-devel

1
chrome: error while loading shared libraries: libXcomposite.so.1: cannot open shared object file: No such file or directory

解决:yum install libXcomposite

1
chrome: error while loading shared libraries: libgtk-3.so.0: cannot open shared object file: No such file or directory`

解决:yum install gtk3

根据报错安装对应的包即可.

Skipping browser download. "PUPPETEER_SKIP_DOWNLOAD" environment variable wa

http://www.datehoer.com/posts/69c5e43a-6e80-11ee-a697-01b0896cf41d/

作者

datehoer

发布于

2022-04-19

更新于

2023-10-19

许可协议

评论