when i’m use sudo npx playwright install-deps return sudo not found
when i’m use playwright install-deps at console menu , needed password for next step
please help me to install playwright
when i’m use sudo npx playwright install-deps return sudo not found
when i’m use playwright install-deps at console menu , needed password for next step
please help me to install playwright
I have the same issue. I’m not able to playwright install-deps, which is necessary to run playwright …
Running as build command did not work for me.
Hi David,
I’m having the same issue I believe. Playwright comes in two parts, the npm package (installed easily enough - automatically) as well as browsers+systemdeps (these require the manual step as seen in the OP’s post.)
Will this solution you’re suggesting allow these system dependencies to be installed? As I’ve also tried sudo (command wasn’t allowed) and various other ways so far.
I thought I had it working by using it as a build command - it looked like it somewhat installed them during logs - but during a task execution, Playwright said it needed the dependencies. It gets as far as:
Switching to root user to install dependencies...
but hangs there and eventually times out
Hi folks, according to this post Can I pass the login credential as parameters through terminal? · Issue #19107 · microsoft/playwright · GitHub you should just set environment variables with user and password
Many thanks @Lukasz_Oles for your quick response, that is much appreciated.
Just to clarify - setting some kind of admin/password in the Environment Variables in Koyeb should allow system dependencies to be installed? And/or alleviate the hanging that occurs at Switching to root user to install dependencies...
If so, what exactly should I be inserting there? Literally those credentials you mentioned there, or like… my own koyeb login info? I’m a little confused.
I gave up, and decided to try using a Dockerfile to build instead.
That seems to have worked - I can see it properly installing the browsers and system dependencies for Playwright during the build.
However, Playwright itself hangs at its own launch/browser launch:
import { chromium } from "playwright";
export async function scrapeWithPlaywright(url) {
console.log("Playwright initiated...");
const browser = await chromium.launch({
channel: "chromium",
headless: true, // Ensure headless mode
args: ["--no-sandbox", "--disable-setuid-sandbox"], // Fix permissions inside Docker
});
const page = await browser.newPage();
console.log(`Playwrighting to ${url}...`);
It never reaches the second console.log, so clearly it is having trouble launching Chrome.
For reference, my Dockerfile is this:
FROM node:20-bookworm
# Set working directory inside container
WORKDIR /app
# Copy package.json and package-lock.json separately for better caching
COPY package*.json ./
# Install dependencies
RUN npm install
# Copy all remaining files
COPY . .
# Install Playwright dependencies
RUN npx -y playwright@1.50.1 install --with-deps chromium
# Expose 8000
EXPOSE 8000
# Start the app
CMD ["node", "app.js"]
But I don’t think that’s the problem - I am guessing it’s some kind of koyeb/docker/arguments issue
Hello, what instance type are you using? Launching chrome probably requires at least 1GB of ram.
Thank you nils! Smart idea that I didn’t consider. I’m using the free tier, and now you mention it I did read somewhere about a ‘disable-gpu’ flag or similar things that may help reduce ram. I had hoped --no-shell and headless mode (all playwright settings btw) would have rendered ram moot but I actually think you might be right