Steps I followed:
Deploy to Cloud Foundry
https://cap.cloud.sap/docs/guides/deployment/to-cf
1. Prerequisites executed as described in section: https://cap.cloud.sap/docs/guides/deployment/to-cf#prerequisites ; sample code used from https://github.com/capire/bookshop.git
2. Mandatory steps (1.-5.) executed as described in section 'Prepare for Production': https://cap.cloud.sap/docs/guides/deployment/to-cf#prepare-for-production
3. In 'Build and Deploy' 'cds up' command failed with the following output (entire output in [1])
...
[2025-09-26 17:42:07] INFO executing the "npm run build" command...
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error npm run
npm error A complete log of this run can be found in: /Users/d032153/.npm/_logs/2025-09-26T15_42_07_555Z-debug-0.log
[2025-09-26 17:42:07] ERROR could not build the "bookshopvue" module: could not execute the "npm run build" command: exit status 1
make: *** [bookshopvue] Error 1
[2025-09-26 17:42:07] ERROR could not build the MTA project: could not execute the "make -f Makefile_20250926174144.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2
Error: could not build the MTA project: could not execute the "make -f Makefile_20250926174144.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2
Command failed: mbt build -t gen --mtar mta.tar
...
Any idea what went wrong here?
Thank you!
[1]'cds up': detailed output
$: ~/dev/tmp/bookshop cds up
npm i --package-lock-only --prefix /Users/d032153/dev/tmp/bookshop/app/vue
up to date, audited 1 package in 385ms
found 0 vulnerabilities
npm i --package-lock-only --prefix .deploy/app-router
up to date, audited 214 packages in 6s
24 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
mbt build -t gen --mtar mta.tar
[2025-09-26 17:41:44] INFO Cloud MTA Build Tool version 1.2.34
[2025-09-26 17:41:44] INFO generating the "Makefile_20250926174144.mta" file...
[2025-09-26 17:41:44] INFO done
[2025-09-26 17:41:44] INFO executing the "make -f Makefile_20250926174144.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command...
[2025-09-26 17:41:44] INFO validating the MTA project
[2025-09-26 17:41:44] INFO running the "before-all" build...
[2025-09-26 17:41:44] INFO executing the "npm ci" command...
...
added 290 packages, and audited 291 packages in 3s
27 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[2025-09-26 17:41:47] INFO executing the "npx cds build --production" command...
.building project with {
versions: { cds: '9.3.1', compiler: '6.3.6', dk: '9.3.2' },
target: 'gen',
tasks: [
{ src: 'db', for: 'hana', options: { model: [ 'db', 'srv', 'app', '@sap/cds/srv/outbox' ] } },
{ src: 'srv', for: 'nodejs', options: { model: [ 'db', 'srv', 'app', '@sap/cds/srv/outbox' ] } }
]
}
.done > wrote output to:
gen/db/init.js
gen/db/package.json
gen/db/src/.hdiconfig
gen/db/src/gen/.hdiconfig
gen/db/src/gen/.hdinamespace
gen/db/src/gen/AdminService.Authors.hdbview
gen/db/src/gen/AdminService.Books.hdbview
gen/db/src/gen/AdminService.Books_texts.hdbview
gen/db/src/gen/AdminService.Currencies.hdbview
gen/db/src/gen/AdminService.Currencies_texts.hdbview
gen/db/src/gen/AdminService.Genres.hdbview
gen/db/src/gen/AdminService.Genres_texts.hdbview
gen/db/src/gen/CatalogService.Books.hdbview
gen/db/src/gen/CatalogService.Books_texts.hdbview
gen/db/src/gen/CatalogService.Currencies.hdbview
gen/db/src/gen/CatalogService.Currencies_texts.hdbview
gen/db/src/gen/CatalogService.Genres.hdbview
gen/db/src/gen/CatalogService.Genres_texts.hdbview
gen/db/src/gen/CatalogService.ListOfBooks.hdbview
gen/db/src/gen/cds.outbox.Messages.hdbtable
gen/db/src/gen/data/sap.capire.bookshop-Authors.csv
gen/db/src/gen/data/sap.capire.bookshop-Authors.hdbtabledata
gen/db/src/gen/data/sap.capire.bookshop-Books.csv
gen/db/src/gen/data/sap.capire.bookshop-Books.hdbtabledata
gen/db/src/gen/data/sap.capire.bookshop-Books.texts.csv
gen/db/src/gen/data/sap.capire.bookshop-Books.texts.hdbtabledata
gen/db/src/gen/data/sap.capire.bookshop-Genres.csv
gen/db/src/gen/data/sap.capire.bookshop-Genres.hdbtabledata
gen/db/src/gen/localized.AdminService.Books.hdbview
gen/db/src/gen/localized.AdminService.Currencies.hdbview
... 25 more. Run with DEBUG=build to show all files.
build completed in 1767 ms
[2025-09-26 17:41:49] INFO validating the MTA project
[2025-09-26 17:41:49] INFO building the "bookshop-srv" module...
[2025-09-26 17:41:49] INFO executing the "npm clean-install --production" command...
npm warn config production Use `--omit=dev` instead.
added 88 packages, and audited 89 packages in 797ms
15 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[2025-09-26 17:41:50] INFO the build results of the "bookshop-srv" module will be packaged and saved in the "gen/.bookshop_mta_build_tmp/bookshop-srv" folder
[2025-09-26 17:41:51] INFO finished building the "bookshop-srv" module
[2025-09-26 17:41:51] INFO building the "bookshop-db-deployer" module...
[2025-09-26 17:41:51] INFO executing the "npm install --production" command...
npm warn config production Use `--omit=dev` instead.
.
added 28 packages, and audited 29 packages in 1s
3 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[2025-09-26 17:41:53] INFO the build results of the "bookshop-db-deployer" module will be packaged and saved in the "gen/.bookshop_mta_build_tmp/bookshop-db-deployer" folder
[2025-09-26 17:41:53] INFO finished building the "bookshop-db-deployer" module
[2025-09-26 17:41:53] INFO building the "bookshop" module...
[2025-09-26 17:41:53] INFO executing the "npm install --production" command...
npm warn config production Use `--omit=dev` instead.
.
added 213 packages, and audited 214 packages in 1s
24 packages are looking for funding
run `npm fund` for details
found 0 vulnerabilities
[2025-09-26 17:41:54] INFO the build results of the "bookshop" module will be packaged and saved in the "gen/.bookshop_mta_build_tmp/bookshop" folder
[2025-09-26 17:42:07] INFO finished building the "bookshop" module
[2025-09-26 17:42:07] INFO building the "bookshopvue" module...
[2025-09-26 17:42:07] INFO executing the "npm ci" command...
up to date, audited 1 package in 260ms
found 0 vulnerabilities
[2025-09-26 17:42:07] INFO executing the "npm run build" command...
npm error Missing script: "build"
npm error
npm error To see a list of scripts, run:
npm error npm run
npm error A complete log of this run can be found in: /Users/d032153/.npm/_logs/2025-09-26T15_42_07_555Z-debug-0.log
[2025-09-26 17:42:07] ERROR could not build the "bookshopvue" module: could not execute the "npm run build" command: exit status 1
make: *** [bookshopvue] Error 1
[2025-09-26 17:42:07] ERROR could not build the MTA project: could not execute the "make -f Makefile_20250926174144.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2
Error: could not build the MTA project: could not execute the "make -f Makefile_20250926174144.mta p=cf mtar=mta.tar strict=true mode= t=\"gen\"" command: exit status 2
Command failed: mbt build -t gen --mtar mta.tar
Request clarification before answering.
This log entry indicates that the package.json file does not have a script with "build" name:
npm error Missing script: "build"
for example:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi AntalP,
thank you for your comments.
The sample/repo I'm using is public pls check the script section: https://github.com/capire/bookshop/blob/main/package.json#L19
If there is anything you know I should/could fix pls let me know and I try it out.
Best regards, Jens
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.