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 <zhanghongyu@xiaomi.com>
This commit is contained in:
zhanghongyu 2025-08-19 10:53:39 +08:00 committed by Xiang Xiao
parent 637f15ff3c
commit e953bbd47c

View file

@ -70,6 +70,9 @@ RUN mkdir -p /tools/gn \
&& cd gn && ./build/gen.py \
&& cd out && ninja
# Upgrade nodejs to the stable version we need before install zap
RUN npm install -g n && n 20.10.0 node && hash -r
ENV ZAP_INSTALL_PATH=/tools/zap_release
RUN mkdir -p $ZAP_INSTALL_PATH \
&& cd $ZAP_INSTALL_PATH \
@ -398,8 +401,8 @@ RUN pip3 install stringcase
RUN pip3 install jinja2
RUN pip3 install coloredlogs
# Upgrade nodejs to the latest version
RUN npm install -g n && n stable && hash -r
# Upgrade nodejs to the stable version we need
RUN npm install -g n && n 20.10.0 node && hash -r
# Used to generate symbol table files