Puppeteer works on Mac, but not on VPS with Ubuntu

I have a Puppeteer program that works perfectly on my local machine running macOS, but it fails to run on a VPS with Ubuntu 18.04.

When I try to run it, I get the following error: "Error while loading shared libraries: libnss3.so: cannot open shared object file: No such file or directory."

Answers

  • Gravatar — онлайн-сервис, позволяющий пользователям Интернета поддерживать постоянную картинку на большинстве сайтов.

    William Moore

    The error indicates that the necessary libraries aren't installed on your VPS.

    		
    Install libnss3 and other Puppeteer dependencies using this command: sudo apt-get install -y gconf-service libnss3 libasound2 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgcc1 libgconf-2-4 libgdk-pixbuf2.0-0 libglib2.0-0 libgtk-3-0 libnspr4 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 ca-certificates fonts-liberation libappindicator1 lsb-release xdg-utils wget libgbm-dev

    If you encounter similar errors afterward, continue installing the missing libraries until everything works.

    0