From b9db46cda5e50163973877fbfb331fd7bd9eac3d Mon Sep 17 00:00:00 2001 From: Michael Kriese Date: Mon, 1 Jul 2024 16:27:59 +0200 Subject: [PATCH] feat(node)!: drop `.npm-global/bin` from path --- src/cli/tools/node/index.ts | 4 ---- test/node/Dockerfile | 41 ++++++++----------------------------- 2 files changed, 8 insertions(+), 37 deletions(-) diff --git a/src/cli/tools/node/index.ts b/src/cli/tools/node/index.ts index cb6e1f5ea2..2a3292766f 100644 --- a/src/cli/tools/node/index.ts +++ b/src/cli/tools/node/index.ts @@ -147,10 +147,6 @@ export class InstallNodeService extends InstallNodeBaseService { await this.pathSvc.resetToolEnv(this.name); await this.postInstall(version); - await this.pathSvc.exportToolPath( - this.name, - join(this.envSvc.userHome, '.npm-global', 'bin'), - ); await this.pathSvc.exportToolEnv(this.name, { NO_UPDATE_NOTIFIER: '1', npm_config_update_notifier: 'false', diff --git a/test/node/Dockerfile b/test/node/Dockerfile index f899a08763..e24f5485d2 100644 --- a/test/node/Dockerfile +++ b/test/node/Dockerfile @@ -66,17 +66,6 @@ RUN npm install -g re2@1.20.9 #-------------------------------------- FROM build AS testb -ARG APT_HTTP_PROXY - -RUN npm install -g yarn - -RUN set -ex; \ - [ "$(command -v yarn)" = "/home/${USER_NAME}/.npm-global/bin/yarn" ] && echo "works" || exit 1; \ - yarn --version; - -RUN set -ex; cd a; yarn; [[ -d node_modules/.bin ]] || exit 1 - - SHELL [ "/bin/sh", "-c" ] USER root @@ -90,6 +79,8 @@ RUN set -ex; \ [ "$(command -v yarn)" = "/usr/local/bin/yarn" ] && echo "works" || exit 1; \ yarn --version +RUN set -ex; cd a; yarn; test -d node_modules/.bin || exit 1 + RUN install-tool yarn 2.4.2 RUN install-tool yarn 3.8.1 @@ -102,31 +93,22 @@ RUN install-tool yarn 4.3.1 FROM build AS testc -ARG APT_HTTP_PROXY - # renovate: datasource=npm RUN install-tool pnpm 9.4.0 RUN set -ex; \ pnpm --version; +SHELL [ "/bin/sh", "-c" ] RUN set -ex; cd a; pnpm i - -SHELL [ "/bin/sh", "-c" ] -RUN set -ex; \ - pnpm --version \ - [ "$(command -v pnpm)" = "/home/${USER_NAME}/bin/pnpm" ] && echo "works" || exit 1; - #-------------------------------------- # test: node 18 #-------------------------------------- FROM base AS testd -ARG APT_HTTP_PROXY - USER 1000 # renovate: datasource=node @@ -134,13 +116,13 @@ RUN install-tool node v18.20.3 RUN npm install -g yarn RUN set -ex; \ - [ "$(command -v yarn)" = "/home/${USER_NAME}/.npm-global/bin/yarn" ] && echo "works" || exit 1; \ - yarn --version; + [ "$(command -v yarn)" = "" ] && echo "works" || exit 1; \ + true; # renovate: datasource=npm RUN install-tool yarn 1.22.22 RUN set -ex; \ - [ "$(command -v yarn)" = "/home/${USER_NAME}/.npm-global/bin/yarn" ] && echo "works" || exit 1; \ + [ "$(command -v yarn)" = "/usr/local/bin/yarn" ] && echo "works" || exit 1; \ yarn --version; @@ -273,15 +255,6 @@ FROM build AS testj USER 1111:0 -ARG APT_HTTP_PROXY - -RUN npm install -g yarn - -RUN set -ex; \ - [ "$(command -v yarn)" = "/home/${USER_NAME}/.npm-global/bin/yarn" ] && echo "works" || exit 1; \ - yarn --version; - -RUN set -ex; ls -lah /test/a; cd a; yarn SHELL [ "/bin/sh", "-c" ] @@ -292,6 +265,8 @@ RUN set -ex; \ [ "$(command -v yarn)" = "/usr/local/bin/yarn" ] && echo "works" || exit 1; \ yarn --version +RUN set -ex; ls -lah /test/a; cd a; yarn + RUN install-tool yarn 1.22.15 #--------------------------------------