cancel
Showing results for 
Search instead for 
Did you mean: 

CAP-Apps crashes after deploying when trying to start

haykma
Participant
0 Kudos

Hi Community,

i have developed a cap-application which i already could deploy in the past. Now, after developing a while and testing in hybrid mode (using destination), i tried to build and deploy the actual state.
After deploying when the deployer tries to start the cap-app (approuter + service) i get the error "cds: not found".
Does anyone have an idea where to look and how to solve this error?

As an attachment i have added a screenshot from log of deployment to btp.



kind regards
Matthias

chgeo
Employee
Employee
0 Kudos

Please check your `package.json` (at root level or in `srv`) to have `@sap/cds` as a dependency. This module has the `cds` executable that is missing here.

haykma
Participant
0 Kudos

Hi christian.georgi

thanks for your answer.
I have already an entry for "@sap/cds" in package.json in section "dependencies" of root.

See attached screenshot of the dependencies-section of package.json

crash-cdsnotfound2.jpg

regards
Matthias

chgeo
Employee
Employee
0 Kudos

Dependency list looks good. Not sure what caused the issue then.

  • Check after `cds build` that gen/srv/package.json is correct
  • If not, check that there is no duplicate of package.json in your code tree
  • Check the npm start script
  • Try locally by using `npm start` after npm install'ing all modules again
  • Provide the full error log.
  • haykma
    Participant
    0 Kudos

    Hi christian.georgi ,

    package.json is present in the right place after building (its in gen/srv/package.json). and has the same values in dependenies-section.
    I' will try to get more details

    kind regards
    Matthias

    Accepted Solutions (1)

    Accepted Solutions (1)

    haykma
    Participant

    I don't really now what happend and why i had this problems.
    I tried Windows Linux Shell (WLS) for building and deploying. Created a new package-lock.json.
    And after doing this it suddenly worked...

    Thanx to christian.georgi for caring.

    kind regards
    Matthias

    karstenvoigt
    Participant
    0 Kudos

    Thanks for your answer; I had a similar issue and checking (updating) the package-lock.json did solve it.

    Answers (1)

    Answers (1)

    FelixB
    Employee
    Employee
    0 Kudos

    Hi,

    I am hitting the same issue. I try to deploy the hello world app from the cloud-cap-samples to a test space we set up in our team BTP account. I put @Sap/cds in the dependencies. I did npm i, cds add cf-manifest,  cds build --production, then cf create-service-push.
    During deployment I see:

    Installing node modules (package.json + package-lock.json)
    added 74 packages, and audited 75 packages in 1s

    so packages should be there. When deplyoment finishes I get the same as Matthias:

    2024-02-13T11:00:19.59+0100 [APP/PROC/WEB/0] OUT > hello@1.0.0 start
    2024-02-13T11:00:19.59+0100 [APP/PROC/WEB/0] OUT > cds serve
    2024-02-13T11:00:19.60+0100 [APP/PROC/WEB/0] ERR sh: 1: cds: not found

    I would be glad if someone had an idea what is wrong here. Thanks in advance!
    Felix