Skip to content

Commit e953bbd

Browse files
zhhyu7xiaoxiang781216
authored andcommitted
Dockerfile: fix matter build error
when the version of nodejs used during the installation of the dependency library is too different from the version of nodejs actually used, we may encounter version incompatibility issues, resulting in a runtime crash. Signed-off-by: zhanghongyu <[email protected]>
1 parent 637f15f commit e953bbd

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tools/ci/docker/linux/Dockerfile

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,9 @@ RUN mkdir -p /tools/gn \
7070
&& cd gn && ./build/gen.py \
7171
&& cd out && ninja
7272

73+
# Upgrade nodejs to the stable version we need before install zap
74+
RUN npm install -g n && n 20.10.0 node && hash -r
75+
7376
ENV ZAP_INSTALL_PATH=/tools/zap_release
7477
RUN mkdir -p $ZAP_INSTALL_PATH \
7578
&& cd $ZAP_INSTALL_PATH \
@@ -398,8 +401,8 @@ RUN pip3 install stringcase
398401
RUN pip3 install jinja2
399402
RUN pip3 install coloredlogs
400403

401-
# Upgrade nodejs to the latest version
402-
RUN npm install -g n && n stable && hash -r
404+
# Upgrade nodejs to the stable version we need
405+
RUN npm install -g n && n 20.10.0 node && hash -r
403406

404407
# Used to generate symbol table files
405408

0 commit comments

Comments
 (0)