Skip to content

Commit 1a24992

Browse files
committed
Set owner of Node.js dependencies
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 <[email protected]>
1 parent 7e6266d commit 1a24992

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

bin/setup

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,12 @@ if [[ ! -z "$DEVELOPMENT" && $DEVELOPMENT -eq 1 ]]; then
216216
fi
217217

218218
if [ ! -d ${ROOT}/node_modules ]; then
219-
${RUN} npm i
219+
${RUN} sh -c '
220+
npm i
221+
npm_res=$?
222+
chown -R "$(whoami):$(whoami)" ./node_modules
223+
exit $npm_res
224+
'
220225
fi
221226

222227
if [ "${CONTAINER_TYPE}" == "devcontainer" ]; then

0 commit comments

Comments
 (0)