FROM node:lts-bookworm # Install build tools and Python 2 for building native modules (e.g. node-sass) RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends python2 make g++; \ rm -rf /var/lib/apt/lists/* WORKDIR /app # Install dependencies (preferable to copy package manifests first for caching) COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . ./ # Build the project from source into dist/ RUN npm run build # Provide an interactive shell by default for exploration CMD ["bash"]
# Ignore node_modules, build artifacts and docs node_modules/ dist/ docs/ docs-dist/ .git/ .github/ coverage/ *.log *.tmp .vscode/ *.swp .DS_Store
- Failing step (failing command/step): [2/7] RUN set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/* - Exact error message and exit code: 11.57 Package python2 is not available, but is referred to by another package. 11.57 This may mean that the package is missing, has been obsoleted, or 11.57 is only available from another source 11.57 However the following packages replace it: 11.57 dh-python 11.57 11.57 E: Package 'python2' has no installation candidate ERROR: failed to build: failed to solve: process "/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100 - Missing packages or files mentioned: - Missing package: python2 (not available in the base image's Debian Bookworm repository) - Replaced by: dh-python (suggested replacement) - Version mismatch / context info: - Base image in use: node:lts-bookworm (Debian Bookworm) - Python 2 is no longer available in Bookworm; the Dockerfile attempts to install Python 2 for building native modules (e.g., node-sass), which is incompatible with the current Debian Bookworm repository. Consider using Python 3 or a base image that still provides Python 2 support, or install Python 2 from an alternative source if necessary.
FROM node:lts-bookworm # Install build tools and Python 3 for building native modules RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends python3 make g++; \ rm -rf /var/lib/apt/lists/* # Ensure Python 3 is used by node-gyp / npm ENV PYTHON=/usr/bin/python3 RUN npm config set python /usr/bin/python3 WORKDIR /app # Install dependencies (prefers npm ci for exact lockfile versions) COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . ./ # Build the project from source into dist/ RUN npm run build # Default command CMD ["bash"]
Summary (under 1500 chars): - Exact error message and exit code: - Error: npm error `python` is not a valid npm option - Exit code: 1 - A complete log of this run can be found in: /root/.npm/_logs/2026-03-18T11_33_37_650Z-debug-0.log - Failing command/step: - Dockerfile step [3/8]: RUN npm config set python /usr/bin/python3 - Missing packages or files mentioned: - None indicated as missing. Python 3, make, and g++ appeared installed; no missing file/package referenced. - Version mismatch info: - Indicates a mismatch where the installed npm version does not recognize the config option "python" (i.e., "npm config set python /usr/bin/python3" is not a valid npm option in this environment). Base image is node:lts-bookworm, with Debian bookworm, and Python 3 already installed, but the npm option is not supported.
FROM node:lts-buster # Install build tools and Python 2 for building native modules (e.g. node-sass) RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends python2 make g++; \ rm -rf /var/lib/apt/lists/* # Tell npm/node-gyp to use Python 2 ENV PYTHON=/usr/bin/python2 WORKDIR /app # Install dependencies (preferable to copy package manifests first for caching) COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . ./ # Build the project from source into dist/ RUN npm run build # Default command CMD ["bash"]
Actionable summary: - Build status: build_failed - Failing step: [2/7] RUN set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/* - Exact error (exit code 100): The build failed with: ERROR: failed to build: failed to solve: process "/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100 - Repository errors (missing Release files): - 0.282 Err:4 http://deb.debian.org/debian buster Release 404 Not Found - 0.282 IP: 151.101.22.132 80 - 0.288 Err:5 http://deb.debian.org/debian-security buster/updates Release 404 Not Found - 0.288 IP: 151.101.22.132 80 - 0.293 Err:6 http://deb.debian.org/debian buster-updates Release 404 Not Found - 0.293 IP: 151.101.22.132 80 - 0.304 E: The repository 'http://deb.debian.org/debian buster Release' does not have a Release file. - 0.304 E: The repository 'http://deb.debian.org/debian-security buster/updates Release' does not have a Release file. - 0.304 E: The repository 'http://deb.debian.org/debian buster-updates Release' does not have a Release file. - Missing packages/files context: - The step attempts to install python2, make, g++; apt-get update cannot fetch Release files, so no package files retrieved. - Root cause / version mismatch: - Base image: node:lts-buster (Debian 10, "buster") - Debian Buster repositories are End of Life; no Release files available, causing apt errors. - Dockerfile context (reference): Dockerfile:4 3 | # Install build tools and Python 2 for building native modules (e.g. node-sass) 4 | >>> RUN set -eux; \ 5 | >>> apt-get update; \ 6 | >>> apt-get install -y --no-install-recommends python2 make g++; \ 7 | >>> rm -rf /var/lib/apt/lists/* - Recommendations: - Upgrade base image to a supported Debian release (e.g., bullseye or bookworm) or switch to an archive/old-releases mirror if staying with Buster. - Note: Python 2 is EOL in newer Debian releases; prefer Python 3 where feasible.
- Exact error message and exit code
- "ERROR: failed to build: failed to solve: process "/bin/sh -c set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/*" did not complete successfully: exit code: 100"
- Failing command/step
- [2/7] RUN set -eux; apt-get update; apt-get install -y --no-install-recommends python2 make g++; rm -rf /var/lib/apt/lists/*
- Dockerfile snippet shows:
- Dockerfile:4
- RUN set -eux; \
apt-get update; \
apt-get install -y --no-install-recommends python2 make g++; \
rm -rf /var/lib/apt/lists/*
- Missing packages or files mentioned
- Packages requested for installation: python2, make, g++
- apt-get update attempts fail due to missing Release files for Debian Buster:
- 404 Not Found [IP: 151.101.22.132 80] (deb.debian.org/debian buster Release)
- 404 Not Found [IP: 151.101.22.132 80] (deb.debian.org/debian-security buster/updates Release)
- 404 Not Found [IP: 151.101.22.132 80] (deb.debian.org/debian buster-updates Release)
- E: The repository 'http://deb.debian.org/debian buster Release' does not have a Release file.
- E: The repository 'http://deb.debian.org/debian-security buster/updates Release' does not have a Release file.
- E: The repository 'http://deb.debian.org/debian buster-updates Release' does not have a Release file.
- Version mismatch info
- Base image in use: node:lts-buster (Debian Buster)
- Debian Buster repos for Release files appear unavailable (end-of-life), causing apt-get update to fail
- This indicates a mismatch between the old Debian 10 (buster) base image and current repositories; upgrading the base image to a newer Debian release (e.g., bullseye/bookworm) or updating repository sources is needed.FROM node:lts-bookworm # Install build tools and Python 3 for building native modules RUN set -eux; \ apt-get update; \ apt-get install -y --no-install-recommends python3 make g++; \ rm -rf /var/lib/apt/lists/* # Tell tooling to use Python 3 for node-gyp ENV PYTHON=/usr/bin/python3 WORKDIR /app # Install dependencies (preferable to copy package manifests first for caching) COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . ./ # Build the project from source into dist/ RUN npm run build # Default command CMD ["bash"]
- Failing step: [5/7] RUN npm ci - Exact error message and exit code: - npm ERR! Build failed with error code: 1 - SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)? - gyp ERR! configure error - gyp ERR! cwd /app/node_modules/node-sass - gyp ERR! node -v v24.14.0 - gyp ERR! node-gyp -v v3.8.0 - npm error code 1 - Exit code: 1 - Missing packages or files mentioned: - No explicit missing file listed. The failure is due to incompatibility: node-sass (and its node-gyp) cannot run with Node 24 and Python 3 in this environment. - The log shows Python3 is used (Python in PATH: /usr/bin/python3), while node-gyp v3.8.0 expects Python 2.x (which would avoid the Python 3 print() syntax issue). - Version mismatch info: - Node version: v24.14.0 - node-gyp version: v3.8.0 - Python: /usr/bin/python3 (Python 3) - This combination (node-sass with node-gyp 3.8.0 on Node 24, using Python 3) causes the SyntaxError and build failure. - Quick takeaway: - The build fails due to an incompatibility between Node 24, node-sass (via node-gyp 3.8.0), and Python 3. Consider downgrading Node to a version supported by node-sass (e.g., Node 16/18) or replacing node-sass with sass (dart-sass) to align with newer Node versions.
FROM node:14-bullseye # Build dependencies using npm ci; this Node version is chosen to better align with node-sass v4.14.x WORKDIR /app # Install dependencies (prefer npm ci for exact lockfile versions) COPY package.json package-lock.json ./ RUN npm ci # Copy the rest of the source code COPY . ./ # Build the project from source into dist/ RUN npm run build # Default command CMD ["bash"]
Smoke [PASS]: test -d dist Smoke [PASS]: ls -la dist | head -n 5 Smoke [PASS]: node -v