Build error when using docker dev container: ELIFECYCLE Command failed with exit code 1

Describe the problem/error/question

I tried to set up the docker dev container in Visual Studio Code.

But when I run the build pnpm run build the build fails when building n8n-editor-ui.

What is the error message (if any)?

...
n8n-editor-ui:popularity-cache-marker: 
n8n-editor-ui:popularity-cache-marker: > [email protected] popularity-cache-marker /workspaces/n8n/packages/frontend/editor-ui
n8n-editor-ui:popularity-cache-marker: > node scripts/cache-marker.mjs
n8n-editor-ui:popularity-cache-marker: 
n8n-editor-ui:fetch-popularity: cache miss, executing daaf7796e7ced853
n8n-editor-ui:fetch-popularity: 
n8n-nodes-base:build: 
n8n-nodes-base:build: > [email protected] build /workspaces/n8n/packages/nodes-base
n8n-nodes-base:build: > tsc --build tsconfig.build.cjs.json && pnpm copy-nodes-json && tsc-alias -p tsconfig.build.cjs.json && pnpm n8n-copy-static-files && pnpm n8n-generate-translations && pnpm n8n-generate-metadata
n8n-nodes-base:build: 
n8n-editor-ui:fetch-popularity: 
n8n-editor-ui:fetch-popularity: > [email protected] fetch-popularity /workspaces/n8n/packages/frontend/editor-ui
n8n-editor-ui:fetch-popularity: > node scripts/fetch-node-popularity.mjs
n8n-editor-ui:fetch-popularity: 
n8n-editor-ui:fetch-popularity: Fetching node popularity data from: https://internal-production.app.n8n.cloud/webhook/nodes-popularity-scores
n8n-editor-ui:fetch-popularity: Successfully fetched popularity data for 1000 nodes
n8n-editor-ui:fetch-popularity: Saved popularity data to /workspaces/n8n/packages/frontend/editor-ui/.build/node-popularity.json with 1000 nodes
n8n-editor-ui:build: cache miss, executing 0bbf4856a11a9281
n8n-editor-ui:build: 
n8n-editor-ui:build: 
n8n-editor-ui:build: > [email protected] build /workspaces/n8n/packages/frontend/editor-ui
n8n-editor-ui:build: > cross-env VUE_APP_PUBLIC_PATH="/{{BASE_PATH}}/" NODE_OPTIONS="--max-old-space-size=8192" vite build
n8n-editor-ui:build: 
n8n-editor-ui:build: rolldown-vite v7.1.16 building for production...
n8n-editor-ui:build: <script src="/{{BASE_PATH}}/static/base-path.js"> in "/index.html" can't be bundled without type="module" attribute
n8n-editor-ui:build: <script src="/{{BASE_PATH}}/static/posthog.init.js"> in "/index.html" can't be bundled without type="module" attribute
n8n-editor-ui:build: 
n8n-editor-ui:build: /{{BASE_PATH}}/static/prefers-color-scheme.css doesn't exist at build time, it will remain unchanged to be resolved at runtime
n8n-editor-ui:build: transforming (0) src/main.tsBrowserslist: browsers data (caniuse-lite) is 6 months old. Please run:
n8n-editor-ui:build:   npx update-browserslist-db@latest
n8n-editor-ui:build:   Why you should do it regularly: https://github.com/browserslist/update-db#readme
n8n-editor-ui:build: transforming (2408) ../../../node_modules/.pnpm/[email protected]/node_modul[plugin rolldown:vite-resolve] Module "os" has been externalized for browser compatibility, imported by "/workspaces/n8n/node_modules/.pnpm/[email protected]/node_modules/recast/lib/util.js". See https://vite.dev/guide/troubleshooting.html#module-externalized-for-browser-compatibility for more details.
n8n-editor-ui:build: transforming (6019) ../../../node_modules/.pnpm/[email protected]/node_modules/c ELIFECYCLE  Command failed with exit code 1.
n8n-editor-ui:build: ERROR: command finished with error: command (/workspaces/n8n/packages/frontend/editor-ui) /home/node/.local/share/pnpm/.tools/pnpm/10.18.3/bin/pnpm run build exited (1)
n8n-nodes-base:build:  ELIFECYCLE  Command failed.
n8n-editor-ui#build: command (/workspaces/n8n/packages/frontend/editor-ui) /home/node/.local/share/pnpm/.tools/pnpm/10.18.3/bin/pnpm run build exited (1)

 Tasks:    37 successful, 39 total
Cached:    35 cached, 39 total
  Time:    33.222s 
Failed:    n8n-editor-ui#build

 ERROR  run failed: command  exited (1)
 ELIFECYCLE  Command failed with exit code 1.
[39745 ms] postAttachCommand from devcontainer.json failed with exit code 1. Skipping any further user-provided commands.
Done. Press any key to close the terminal.

The host environment that runs the docker container is macOS 15.7.2 (24G325).

I’m struggling to get a more detailed error message, to understand the reason for the error.

This looks like a partial build output that got cut off. Here are the most common solutions for Docker dev container build issues:

• **Clear cache and rebuild**: Run `pnpm clean` followed by `pnpm install` and then `pnpm run build`

• **Check Node.js version**: Ensure you’re using Node.js 18.x or 20.x as specified in the project requirements

• **Memory issues**: If the build is running out of memory, try increasing Docker’s memory allocation or run `pnpm run build --max-old-space-size=4096`

• **Container rebuild**: Sometimes rebuilding the dev container completely (Command Palette > “Dev Containers: Rebuild Container”) resolves dependency conflicts

Could you share the complete error message? The output seems to cut off at “n8n-editor” which would help identify the specific failure point.