From 1a249923d38504b14508834d5bc9904daff4df27 Mon Sep 17 00:00:00 2001 From: Evgeny Semenov Date: Wed, 22 Oct 2025 16:00:29 +0100 Subject: [PATCH] Set owner of Node.js dependencies MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Few files in a node_modules/ folder belong to user who doesn’t exist in a host environmnet when `npm` installs external packages inside container. This change explicitly sets the owner for these files. Signed-off-by: Evgeny Semenov --- bin/setup | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/bin/setup b/bin/setup index 708c9d73f..3d52d12f7 100755 --- a/bin/setup +++ b/bin/setup @@ -216,7 +216,12 @@ if [[ ! -z "$DEVELOPMENT" && $DEVELOPMENT -eq 1 ]]; then fi if [ ! -d ${ROOT}/node_modules ]; then - ${RUN} npm i + ${RUN} sh -c ' + npm i + npm_res=$? + chown -R "$(whoami):$(whoami)" ./node_modules + exit $npm_res + ' fi if [ "${CONTAINER_TYPE}" == "devcontainer" ]; then