Closed c121914yu closed 5 months ago
Hi @c121914yu. If you upgrade node-gyp to >=10 (preferred) or lock the Python version to the one before the distutils removal, the arm64 build should work.
- name: Set up Python
uses: actions/setup-python@v5
with:
# Lock version to avoid "distutils" error because it was removed in Python 3.12
# See: https://github.com/nodejs/node-gyp/issues/2869
# And: https://github.com/nodejs/node-gyp/pull/2923
python-version: '3.11'
- name: Set up Python uses: actions/setup-python@v5 with:
Lock version to avoid "distutils" error because it was removed in Python 3.12
# See: https://github.com/nodejs/node-gyp/issues/2869 # And: https://github.com/nodejs/node-gyp/pull/2923 python-version: '3.11'
Thx you, I switch python versions solved.
# --------- install dependence -----------
FROM python:3.11-alpine AS python_base
# 安装make和g++
RUN apk add --no-cache make g++
FROM node:20.13-alpine AS install
WORKDIR /app
ARG proxy
RUN [ -z "$proxy" ] || sed -i 's/dl-cdn.alpinelinux.org/mirrors.ustc.edu.cn/g' /etc/apk/repositories
RUN apk add --no-cache make g++
# copy py3.11
COPY --from=python_base /usr/local /usr/local
RUN npm install -g pnpm@8.6.2
RUN [ -z "$proxy" ] || pnpm config set registry https://registry.npmmirror.com
COPY pnpm-lock.yaml pnpm-workspace.yaml ./
COPY ./projects/sandbox/package.json ./projects/sandbox/package.json
RUN [ -f pnpm-lock.yaml ] || (echo "Lockfile not found." && exit 1)
RUN pnpm i
But I can't find a way to upgrade node-gyp to 10.x, it seems to specify 9.x all the time.
action:
error
platform=amd64 can be built normally, but if you want to build an arm image you will be prompted with a python error.