From fd78152fc9e2cdf5af622dd66af68278ef5a5727 Mon Sep 17 00:00:00 2001 From: Adriaan van der Bergh Date: Mon, 20 May 2024 19:18:42 +0200 Subject: Fix `.pnpm-store` in devcontainer setup (#1881) Co-authored-by: HiDeoo <494699+HiDeoo@users.noreply.github.com> --- .devcontainer/Dockerfile | 5 +++-- .devcontainer/devcontainer.json | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index f3d56a54..207f5d81 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -1,7 +1,8 @@ # Based on https://github.com/withastro/astro/blob/main/.devcontainer/Dockerfile FROM mcr.microsoft.com/devcontainers/javascript-node:0-18 -# Install latest pnpm -RUN npm install -g pnpm +# We uninstall pnpm here, since we enable the corepack version in the postCreateCommand +# This ensures we respect the "packageManager" version in package.json +RUN npm uninstall -g pnpm COPY welcome-message.txt /usr/local/etc/vscode-dev-containers/first-run-notice.txt \ No newline at end of file diff --git a/.devcontainer/devcontainer.json b/.devcontainer/devcontainer.json index 2b192ec9..47798932 100644 --- a/.devcontainer/devcontainer.json +++ b/.devcontainer/devcontainer.json @@ -3,7 +3,7 @@ "build": { "dockerfile": "Dockerfile" }, - "postCreateCommand": "pnpm install", + "postCreateCommand": "sudo corepack enable pnpm && pnpm config set store-dir /home/node/.pnpm-store && PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=1 pnpm install", "waitFor": "postCreateCommand", "customizations": { "codespaces": { -- cgit