Job jenkins gives error 137 and fails after ng build --aot from angular application

Discussão em 'Angular' iniciado por Suppadeliux, Março 4, 2025.

  1. Suppadeliux

    Suppadeliux Guest

    Being trying to automatize the run of the e2e tests from my angular app in jenkins. The tests are handled thanks to the Cypress framework. The problem is that the jenkins job fails before the tests are even called, so my guess is that there is something wrong with my angular config.

    When I run the same instructions from jenkins locally, I am able to build my app, and run my tests without any problem.

    I found a possible solution which is changing the target": "es2015", to es5, but after doing that, I got lots of errors.

    Here's the some of the output message in jenkins:

    15:26:35 Run `npm audit` for details.
    15:26:35 npm run build
    15:26:35
    15:26:35 > my-app@0.0.1 build
    15:26:35 > ng build --aot
    15:26:35
    15:26:35 Warning: Support was requested for IE 11 in the project's browserslist configuration. IE 11 support is deprecated since Angular v12.
    15:26:35 For more information, see https://angular.io/guide/browser-support
    15:26:35 - Generating browser application bundles (phase: setup)...
    15:29:26 ✔ Browser application bundle generation complete.
    15:29:26 ✔ Browser application bundle generation complete.
    15:29:26 - Generating ES5 bundles for differential loading...
    15:29:26 /tmp/build-ccb28c3f.sh: line 1: 71574 Killed ng build --aot
    15:29:26 make[1]: *** [Makefile:535: webapp] Error 137


    and here, my angular version:

    _ _ ____ _ ___
    / \ _ __ __ _ _ _| | __ _ _ __ / ___| | |_ _|
    / △ \ | '_ \ / _` | | | | |/ _` | '__| | | | | | |
    / ___ \| | | | (_| | |_| | | (_| | | | |___| |___ | |
    /_/ \_\_| |_|\__, |\__,_|_|\__,_|_| \____|_____|___|
    |___/

    Angular CLI: 12.2.17
    Node: 14.20.0
    Package Manager: npm 6.14.17
    OS: linux x64

    Angular: 12.2.16
    ... animations, common, compiler, compiler-cli, core, forms
    ... language-service, localize, platform-browser
    ... platform-browser-dynamic, router

    Package Version
    ---------------------------------------------------------
    @angular-devkit/architect 0.1202.17
    @angular-devkit/build-angular 12.2.17
    @angular-devkit/core 12.2.17
    @angular-devkit/schematics 12.2.17
    @angular/cdk 12.2.13
    @angular/cli 12.2.17
    @schematics/angular 12.2.17
    rxjs 6.6.7
    typescript 4.3.5


    And here's my tsconfig.json

    {
    "compileOnSave": false,
    "compilerOptions": {
    "baseUrl": "./webapp",
    "outDir": "./dist/out-tsc",
    "sourceMap": true,
    "declaration": false,
    "stripInternal": true,
    "module": "es2020",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "noUnusedLocals": true,
    "noUnusedParameters": false,
    "target": "es2015",
    "paths": {
    "jszip": [
    "node_modules/jszip/dist/jszip.min.js"
    ]
    },
    "typeRoots": [
    "node_modules/@types"
    ],
    "lib": [
    "es2017",
    "dom"
    ],
    "plugins": [
    { "name": "typescript-tslint-plugin"}
    ]
    }
    }

    Continue reading...

Compartilhe esta Página