Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

1.2K
Views
Pipeline de Bitbucket: el contenedor 'Build' excedió el límite de memoria

Estoy tratando de ejecutar una canalización para mi aplicación Angular, pero cuando se trata de la parte "npm run build" se bloquea, el motivo del error es "Container" Build "excedió el límite de memoria". Intenté jugar con la configuración de la memoria en el archivo yml, por ejemplo, agregando 'tamaño 2x' y cambiando la cantidad de memoria asignada a la ventana acoplable.

bitbucket-tuberías.yml:

 image: node:14.17.0 options: docker: true size: 2x pipelines: custom: prod-deployment: - step: name: Build angular app #services: # - docker caches: - node services: - docker size: 2x # Double resources available for this step. script: - mv .npmrc_config .npmrc - npm install --unsafe-perm - npm install -g @angular/cli@12.2.6 - free -m - npm run dashboard:build - wget "censored for security" artifacts: - dist/** - step: name: Deploy artifacts using SCP to PROD deployment: production size: 2x # Double resources available for this step. script: - pipe: atlassian/scp-deploy:1.1.0 variables: USER: $USERNAME SERVER: $SERVER REMOTE_PATH: 'Censored for Security' LOCAL_PATH: 'dist/*' dev-deployment: - step: name: Build angular app #services: # - docker caches: - node services: - docker size: 2x # Double resources available for this step. script: - mv .npmrc_config .npmrc - npm install --unsafe-perm - npm install -g @angular/cli@12.2.6 - free -m - npm run build - wget 'Censored for Security' artifacts: - dist/** - step: name: Deploy artifacts using SCP to PROD deployment: production size: 2x # Double resources available for this step. script: - pipe: atlassian/scp-deploy:1.1.0 variables: USER: $USERNAME SERVER: $SERVER REMOTE_PATH: 'Censored for Security' LOCAL_PATH: 'dist/*' definitions: services: docker: memory: 4096

Mensaje de error de la consola:

 Killed npm ERR! code ELIFECYCLE npm ERR! errno 137 npm ERR! build: `node --max_old_space_size=6144 node_modules/@angular/cli/bin/ng build --configuration=calio && npm run ` npm ERR! Exit status 137 npm ERR! npm ERR! Failed at the build script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! /root/.npm/_logs/2021-10-14T08_40_46_012Z-debug.log
over 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Finalmente, encontré una solución a este problema sin reinstalar npm y la estoy publicando porque en el futuro ayudará a alguien. La mayoría de las veces ocurre este error. El montón de javascript se salió de la memoria. Como dice el error, esto no es un problema con npm. Lo único que tenemos que hacer es

en lugar de 'npm run build -prod'

extienda la memoria javascript siguiendo,

nodo --max_old_space_size=4096 node_modules/@angular/cli/bin/ng build

over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!