Skip to content

Commit ab37f73

Browse files
authored
Merge pull request #151 from ByteInternet/only-install-npm-through-apt-when-node-version-is-under-18
Only install npm through APT when node version is under 20
2 parents 6249c2b + 07ec085 commit ab37f73

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

ci/build/Dockerfile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ RUN apt-get update && \
5050
make \
5151
libtool \
5252
nodejs \
53-
npm \
5453
gnupg \
5554
zip \
5655
bc \
@@ -82,6 +81,13 @@ RUN apt-get update && \
8281
php${PHP_VERSION}-zip \
8382
&& rm -rf /var/lib/apt/lists/*
8483

84+
# Only install npm if node version is less than 20, otherwise it's already installed
85+
RUN if [ "${NODE_VERSION}" -lt 20 ]; then \
86+
apt-get update \
87+
&& apt-get install -y --no-install-recommends npm \
88+
&& rm -rf /var/lib/apt/lists/*; \
89+
fi
90+
8591
COPY ./.git /hypernode/.git
8692
COPY ./bin /hypernode/bin
8793
COPY ./ci /hypernode/ci

0 commit comments

Comments
 (0)