cancel
Showing results for 
Search instead for 
Did you mean: 

Failed to stage build: Start command not specified - CAP

Saif
Product and Topic Expert
Product and Topic Expert

Hi Folks,

Trying to deploy a CAP application as described here - DEV Tutorial. While this works fine on BAS, deployment on CF fails for the service module with error as: StagingError - Staging error: Start command not specified

Logs:

2021-06-17T14:50:26.02+0000 [API/140] ERR Failed to stage build: Start command not specified

2021-06-17T14:50:01.24+0000 [STG/0] ERR No start command specified by buildpack or via Procfile. 2021-06-17T14:50:01.24+0000 [STG/0] ERR App will not start unless a command is provided at runtime.

Tried explicitly giving a command with a task to run npm / node index.js in mta, which didnt work either.

Any idea?

Regards

Saif

iwona_hahn
Product and Topic Expert
Product and Topic Expert
0 Kudos

Maybe thomas.jung can help here?

thomas_jung
Developer Advocate
Developer Advocate

In order prepare your content for deployment to CF you would need to copy the root package.json into the /srv folder. When testing from BAS you are able to just do a cds run or cds serve from the root but when deploying the mta you are now running isolated from the srv folder.

Saif
Product and Topic Expert
Product and Topic Expert

thomas.jung Thank you for the suggestion, after updating the package.json and make some edits to make sure it has the right node dependency to work with cds and adding model reference to - gen/csn./json, it worked like a charm. Needless to say, thank you for your tutorials and videos, they are impressive and extremely helpful.

rauf_shaikh
Active Participant
0 Kudos

Hi saifulla.mohammed ,
Even I facing the same error after following the developer tutorial.

Can you please post your package.json file or project hierarchy so I can relate it and resolve the same.

-Thanks

Rauf Shaikh

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

I am having the same issue.

Can you please post your package.json file or project hierarchy so I can relate it and resolve the same.

Thanks