cancel
Showing results for 
Search instead for 
Did you mean: 

Issue when deploying simple app to BTP using 'cf push'

Melvin11
Discoverer
0 Kudos
296

Hey everyone,

I’m new to BTP apps, and honestly, I’m about to lose it—so I really hope someone can help!

I’m using BAS (Business Application Studio) in case that’s relevant. My goal is simple: deploy a basic Fiori app with a blank page that displays a list of data from a web service. Everything works fine when running it in BAS for testing.

I’ve explored BTP in the past, but due to the complexity around deployments, manifests, YAML files, routes, and MTA, I put it on hold until things hopefully became more stable. Now, I’m trying again and facing deployment issues.

The Problem:

I attempted to deploy the app using cf push. I also tried using MTA, but for some reason, the HTML5 app is not being deployed. The ultimate goal is to add this app to S/4HANA Cloud Public via Launchpad.

When checking the logs with:

 

cf logs <prj_name> --recent

 

I see the following errors (in red):

 

   2025-02-13T06:10:09.11+0000 [APP/PROC/WEB/0] ERR sh: 1: tsc: not found
   2025-02-13T06:10:09.12+0000 [APP/PROC/WEB/0] ERR npm notice
   2025-02-13T06:10:09.12+0000 [APP/PROC/WEB/0] ERR npm notice New major version of npm available! 10.7.0 -> 11.1.0
   2025-02-13T06:10:09.12+0000 [APP/PROC/WEB/0] ERR npm notice Changelog: https://github.com/npm/cli/releases/tag/v11.1.0
   2025-02-13T06:10:09.12+0000 [APP/PROC/WEB/0] ERR npm notice To update run: npm install -g npm@11.1.0
   2025-02-13T06:10:09.12+0000 [APP/PROC/WEB/0] ERR npm notice

 

It seems there are two major issues here:

1. TSC (TypeScript Compiler) not found

2. NPM version inconsistency

 

What I’ve Tried (Without Success)

1️⃣Fixing the tsc: not found Issue

Modified package.json to move TypeScript from devDependencies to dependencies:

 

Modify package.json
"dependencies": {
  "typescript": "^5.2.2"  // Añádelo aquí
},
"devDependencies": {
  
}

 

Installed TypeScript globally:

 

npm install typescript

 

Added a post-install script in package.json:

 

"scripts": {
"postinstall": "npm install -g typescript"
}

 

Verified TypeScript installation: 

 

npx tsc --version #returns 5.7.3

 

Despite all of this, cf push still throws the tsc: not found error.

 

2️⃣Fixing the NPM Version Issue

Updated NPM with:

 

npm install -g npm@11.1.0

 

However, running npm -v still shows the old version.

To fix this, I tried:

 

export PATH=$(npm prefix -g)/bin:$PATH

 

After this, npm -v shows the correct version (11.1.0).

But the errors still persist exactly the same after redeployment.

 

3️⃣ Other Things I’ve Tried (Also Failed)

Specified the Node.js version in package.json:

 

"engines": {
    "node": "20.x"
  }​

 

Created a manifest.yml to reduce memory size (not directly related but worth trying).

Deleted the failed app to free up space in BTP.

Completely removed and reinstalled node_modules:

 

rm -rf node_modules package-lock.json
npm cache clean --force
npm install

 

Yet, nothing has worked.

I’ve already gone through these articles, but they didn’t solve my issue:

🔗 Tips for Running CAP Node.js in SAP BTP

🔗 Error While Deploying CAP Project to CF Trial

My Questions

1. How can I ensure Cloud Foundry uses the correct Node.js and NPM versions during deployment?

2. Why does cf push fail with tsc: not found even though TypeScript is installed globally?

3. What’s the proper way to deploy a simple Fiori app (HTML5) to BTP and register it in S/4HANA Cloud Public via Launchpad?

I’d really appreciate any guidance—thanks in advance! 🚀

 

 

 

View Entire Topic
rotem_puterman-sobe
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi,
Using 'CF push' is not the recommended approach for deploying SAP Fiori applications to SAP BTP, Cloud Foundry environment.
Please refer for the following documentation on how to generate CF deployment configuration for your application in SAP Business Application Studio, and later use it to deploy your application:
https://help.sap.com/docs/bas/developing-sap-fiori-app-in-sap-business-application-studio/generate-d...

https://help.sap.com/docs/bas/developing-sap-fiori-app-in-sap-business-application-studio/deployment...

You can also use SAP Business Application Studio task explorer to easily create and run the relevant tasks to create this configuration and use it for the deployment.

Thanks,

Rotem

 

rotem_puterman-sobe
Product and Topic Expert
Product and Topic Expert
0 Kudos
Editing here - that if your target goal is to deploy to SAP S/4HANA Cloud, you should create deployment configuration to ABAP system and not to deploy to CF at all which is completely different runtime environment. See: https://help.sap.com/docs/bas/developing-sap-fiori-app-in-sap-business-application-studio/generate-d...
Melvin11
Discoverer
0 Kudos
Thanks Rotem, the app I need to deploy needs to be used in S/4HANA Cloud Public, then I should deploy to CF, right?