From 0f94849012b32cc8b1f66f1e45ea1bdd88362a11 Mon Sep 17 00:00:00 2001 From: Autumn-27 <53844290+Autumn-27@users.noreply.github.com> Date: Tue, 28 Jul 2026 12:11:04 -0400 Subject: [PATCH] =?UTF-8?q?fix(docker):=20=E7=94=A8=20NodeSource=20?= =?UTF-8?q?=E8=A3=85=20Node=2020=EF=BC=88Playwright=20=E8=A6=81=E6=B1=82?= =?UTF-8?q?=20>=3D20=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit bookworm 自带的 apt nodejs 是 18.20.4,Playwright 全局安装报 "requires Node.js 20 or higher" 导致镜像构建失败。改为从 NodeSource 装 20.x(自带 npm),移除 apt 的 nodejs/npm。 Co-Authored-By: Claude Opus 4.8 (1M context) --- Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index e45de8d..b2bb58e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,11 +12,13 @@ # docker build -t artex:local . FROM python:3.12-slim-bookworm ARG TARGETARCH -# 常用工具:ripgrep / curl / vim / npm,加一批 recon 常备件(按需增删) +# 常用工具:ripgrep / curl / vim,加一批 recon 常备件(按需增删)。 +# Node 从 NodeSource 装 20.x:bookworm 自带的 apt nodejs 是 18,Playwright 要求 >=20。 RUN apt-get update && apt-get install -y --no-install-recommends \ ca-certificates ripgrep curl wget vim git jq unzip \ - nodejs npm \ dnsutils iputils-ping netcat-openbsd whois nmap \ + && curl -fsSL https://deb.nodesource.com/setup_20.x | bash - \ + && apt-get install -y --no-install-recommends nodejs \ && rm -rf /var/lib/apt/lists/* # 预装 Playwright MCP 与 CLI(全局),运行时不再 npx 联网下载。 # @playwright/mcp:browser MCP 直接 `npx @playwright/mcp`(已全局装好,无需 -y/@latest)。