From: Jérôme Benoit Date: Fri, 20 Jan 2023 16:00:32 +0000 (+0100) Subject: Allow global npm packages install without sudo X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=cd6b37dc58b90e309aaa72a9e20cb213a1f9b0d1;p=mbt-docker.git Allow global npm packages install without sudo Signed-off-by: Jérôme Benoit --- diff --git a/.xmake.cfg b/.xmake.cfg index ce12634..dfceb57 100644 --- a/.xmake.cfg +++ b/.xmake.cfg @@ -1,5 +1,5 @@ [xmake] -version=1.0.13 +version=1.0.14 # https://github.wdf.sap.corp/pages/xmake-ci/User-Guide/Setting_up_a_Build/Release_Procedure/Release_Versions/ [buildplugin] diff --git a/Dockerfile b/Dockerfile index 3fe3d33..6cdb080 100644 --- a/Dockerfile +++ b/Dockerfile @@ -71,8 +71,6 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \ | sort -u \ | xargs -r apt-mark manual \ && apt-get purge -y --auto-remove -o APT::AutoRemove::RecommendsImportant=false \ - # for npm link - && chown -R ${USER}:${USER} /usr/local/lib/node_modules \ && ln -s /usr/local/bin/node /usr/local/bin/nodejs \ # smoke tests && node --version \ @@ -189,5 +187,8 @@ RUN set -ex \ # smoke test && python3 --version +# Allow global npm packages install without sudo +ENV NPM_CONFIG_PREFIX ${USER_HOME_DIR}/.npm-global + WORKDIR /project USER ${USER}