cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

MTB build failure after upgraded to npm 11

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Likes
884

Hi Experts,

We had a MTA project was deployed on BTP cloud foundry,

Initially, we are using node v18, npm 10 without issue.

From current release, BTP required our project to use NPM v11, so that we upgraded all related node modules. And project running on local service without issue.

But when we tried to run the 'Mbt build' to build the mta project (mbt version: v1.2.34),  we are facing following error,

and we checked the "boast" files, both of them are found in respective location.

[2025-01-05 18:02:52]  INFO the build results of the "raasapp2-srv" module will be packaged and saved in the "/Users/i3****/Documents/*****/working/raasdata_project/raasdashboard/raasdatatst4/.raasdatatst4_mta_build_tmp/raasapp2-srv" folder
[2025-01-05 18:03:01] ERROR could not package the "raasapp2-srv" module when archiving: could not read the "/Users/i3****/Documents/****/working/raasdata_project/raasdashboard/raasdatatst4/node_modules/.bin/boast" symbolic link: stat /Users/i3****/Documents/****/working/raasdata_project/raasdashboard/raasdatatst4/node_modules/swagger2openapi/boast.js: no such file or directory
make: *** [raasapp2-srv] Error 1
[2025-01-05 18:03:01] ERROR could not build the MTA project: could not execute the "make -f Makefile_20250105180232.mta p=cf mtar= strict=true mode=" command: exit status 2
Error: could not build the MTA project: could not execute the "make -f Makefile_20250105180232.mta p=cf mtar= strict=true mode=" command: exit status 2

 following are the dependencies in package.json

"engines": {
    "node": "^20",
    "npm": "11.0.0"
  },
  "dependencies": {
    "4": "^0.0.0",
    "6": "0.0.1",
    "@cap-js-community/odata-v2-adapter": "^1.13.8",
    "@sap_oss/alert-notification-client": "^1.7.0",
    "@sap-cloud-sdk/http-client": "^3.25.0",
    "@sap-cloud-sdk/mail-client": "^3.18.1",
    "@sap/audit-logging": "^5.8.1",
    "@sap/cds": "^8.6.0",
    "@sap/cds-compiler": "^5.6.0",
    "@sap/cds-dk": "^8.6.1",
    "@sap/hdbext": "^8.1.0",
    "@sap/logging": "^6",
    "@sap/textbundle": "^4.3.0",
    "@sap/xsenv": "^5.4.0",
    "@sap/xssec": "^4.2.7",
    "axios": "^1.7.9",
    "cap-llm-plugin": "^1.4.5",
    "cds-swagger-ui-express": "^0.10.0",
    "cheerio": "^1.0.0-rc.12",
    "cors": "^2.8.5",
    "csv-parse": "^5.5.5",
    "express": "^4",
    "fast-csv": "^4.3.6",
    "generic-pool": "^3.9.0",
    "hana-cli": "^3.202405.1",
    "hdb": "^0.19.8",
    "passport": "^0.6.0",
    "pdfkit": "^0.13.0",
    "pdfkit-table": "^0.1.99",
    "request": "^2.88.2",
    "sap-hdbext-promisfied": "^2.202410.1",
    "uuid": "^11.0.3"
  },
  "devDependencies": {
    "@cap-js/cds-typer": "^0.31.0",
    "@sap/eslint-plugin-ui5-jsdocs": "^2.0.8",
    "@sap/ux-specification": "^1.124.7",
    "@sapui5/ts-types": "^1.92.2",
    "chai": "^4.3.10",
    "chai-as-promised": "^7.1.1",
    "chai-subset": "^1.6.0",
    "eslint": "^9.17.0",
    "jest": "^29.7.0"
  },

following is the mta.yaml

_schema-version: "3.1"
ID: raasapp2
description: RaaS CAP project.
version: 1.0.22
modules:
- name: raasapp2-srv
  type: nodejs
  path: .
  requires:
  - name: raasapp2-db
  - name: uaa_raasapp2
  - name: raas_email_srv
  provides:
  - name: srv-api
    properties:
      srv-url: ${default-url}
  parameters:
    buildpack: nodejs_buildpack
    disk-quota: 2048M
    memory: 2048M
    stack: cflinuxfs4
  build-parameters:
    #builder: npm-ci
    ignore:
    - '*default-env.json*'
    - ./db/*.env*
    #- ./db/node_modules
    - ./app
    #- ./app/node_modules
    - ./mta_archives
    - ./db/ddl
    - ./db/dml
    - .git
    - .*.DS_Store
    - .*/*/.DS_Store
    - .*/*/*/.DS_Store


- name: raasapp2-db-deployer
  type: hdb
  path: db
  requires:
  - name: raasapp2-db
    properties:
      TARGET_CONTAINER: ~{hdi-service-name}
  # - name: cross-container-service-1
  #   group: SERVICE_REPLACEMENTS
  #   properties:
  #     key: ServiceName_1
  #     service: ~{the-service-name}
  parameters:
    buildpack: nodejs_buildpack
    stack: cflinuxfs4
  build-parameters:
    ignore:
    - default-env.json
    - .env
    #- '*node_modules*'


- name: app
  type: approuter.nodejs
  path: app
  requires:
  - name: uaa_raasapp2
  - name: srv-api
    group: destinations
    properties:
      forwardAuthToken: true
      name: srv-api
      url: ~{srv-url}
  parameters:
    disk-quota: 256M
    memory: 256M
    keep-existing-routes: true
    stack: cflinuxfs4
  build-parameters:
    ignore:
    - default-env.json
    - .env
    #- '*node_modules*'

resources:
- name: raasapp2-db
  type: com.sap.xs.hdi-container
  parameters:
    service: hana
    service-plan: hdi-shared
  properties:
    hdi-service-name: ${service-name}
# - name: cross-container-service-1
#   type: org.cloudfoundry.existing-service
#   parameters:
#     service-name: CC_ACCESS
#   properties:
#     the-service-name: ${service-name}
- name: uaa_raasapp2
  type: org.cloudfoundry.managed-service
  parameters:
    path: ./xs-security.json
    service: xsuaa
    service-name: raasapp2-xsuaa-service
    service-plan: application
- name: raas_email_srv
  type: org.cloudfoundry.existing-service
  parameters:
    service-name: raas_email_service
  properties:
    the-service-name: ${service-name}
parameters:
  enable-parallel-deployments: true
build-parameters:
  before-all:
  - builder: custom
    commands:
    #- npm config set registry https://registry.npmjs.com/
    #- npm ci
    - npx -p @Pa_Vi/cds-dk@latest cds build --production

can anyone give some clue to fix the problem?

 

Accepted Solutions (0)

Answers (1)

Answers (1)

gregorw
SAP Mentor
SAP Mentor
0 Likes

Hello,

when you use cf buildpacks to get the supported build packs by BTP you find:

5          nodejs_buildpack                   cflinuxfs4   true      false    READY   nodejs_buildpack-cached-cflinuxfs4-v1.8.29.zip

At:

https://github.com/cloudfoundry/nodejs-buildpack/releases/tag/v1.8.29

you will find the supported 20.x Node.JS Versions. The latest one 20.16.0 is 18.20.3. It's npm version seems to be  10.8.1 according to:

https://nodejs.org/en/blog/release/v20.16.0

your engines entry:

"npm": "11.0.0"

will not work for this.

minjie_lao
Product and Topic Expert
Product and Topic Expert
0 Likes

@gregorw,

Thanks for the correction, but i've corrected engines's version, and reinstall the node modules, still facing the same issue while building the MTA file 

 

"engines": {
    "node": "^20.15.1",
    "npm": "10.7.0"
  },