Skip to content

Commit

Permalink
feat(node)!: drop .npm-global/bin from path
Browse files Browse the repository at this point in the history
  • Loading branch information
viceice committed Jul 4, 2024
1 parent 9fee88e commit b9db46c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 37 deletions.
4 changes: 0 additions & 4 deletions src/cli/tools/node/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down
41 changes: 8 additions & 33 deletions test/node/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -66,17 +66,6 @@ RUN npm install -g [email protected]
#--------------------------------------
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
Expand All @@ -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

Expand All @@ -102,45 +93,36 @@ 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
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;


Expand Down Expand Up @@ -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" ]

Expand All @@ -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

#--------------------------------------
Expand Down

0 comments on commit b9db46c

Please sign in to comment.