From 4fe3ef733850349f48db11dc4dd587c4d5b70a64 Mon Sep 17 00:00:00 2001 From: David Taylor Date: Tue, 4 Jul 2023 14:39:54 +0100 Subject: [PATCH] FIX: Cleanup node_modules when using non-default branch (#722) Yarn seems to have issues 'downgrading' our set of packages from tests-passed (which are pre-installed in the base image) to the versions on the stable branch. In the medium term we intend to switch to the pnpm package manager, which shouldn't have this issue. In the meantime, we can work around the problem by deleting the pre-installed node_modules and installing from scratch. https://meta.discourse.org/t/270491 --- templates/web.template.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/templates/web.template.yml b/templates/web.template.yml index 7d716cc..12ba935 100644 --- a/templates/web.template.yml +++ b/templates/web.template.yml @@ -171,6 +171,10 @@ run: - exec: cd: $home cmd: + - |- + if [ "$version" != "tests-passed" ]; then + rm -rf app/assets/javascripts/node_modules + fi - su discourse -c 'yarn install --frozen-lockfile && yarn cache clean' - exec: -- 2.25.1