Script fixes Playwright shared library error in rootless Linux environments
Developers running Playwright in restricted environments like containers or cloud platforms often hit a 'libnspr4.so not found' error because the tool's dependency installer relies on apt-get, which requires root access. A developer encountered this while setting up browser automation for an AI coding agent in a locked-down sandbox with no sudo privileges. The workaround uses apt-get download and dpkg-deb -x to fetch and unpack required libraries into a user-owned directory, then points the browser to them via LD_LIBRARY_PATH. The developer has packaged this approach into an open-source MIT-licensed shell script called rootless-playwright, available on GitHub. Running the script automates the entire process — from querying Playwright for missing dependencies to verifying the browser launches — without touching system directories.
This is an AI-generated summary. ShortSingh links to the original source for the complete article.
Discussion (0)
Log in to join the discussion and vote.
Log in