cancel
Showing results for 
Search instead for 
Did you mean: 

SAP CAP - Node.js - cf push crashes

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert
0 Kudos
1,918

Hi all,

I'm executing CF Push command in terminal to push app into BTP CF repository, but I'm getting this error when cf push command is executed.

Both risk-management-srv and risk-management-db-deployer are to be pushed at once.

I've run cf logs risk-management --recent and the error message says: 'Unable to require require package/file.json "passport". However, I'd already installed passport module by npm i passport. furthermore, the package-lock.json had been deleted and re-run npm install.

Could anyone provide me any assistance, please?

Best regards

Bruno Franzini

Accepted Solutions (1)

Accepted Solutions (1)

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert

Just found out the resolution...

I've just run the following commands in the sequence:

  1. npm install
  2. cds build/all --clean

Problem is solved.

Thank you

martinstenzig
Contributor
0 Kudos

you probably want to add the complete xsuaa package to be prepared for the future. That Includes passport. The easiest way to do that is: cds add xsuaa

Girish_Kumar_Gu
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi bfranzini01

I've tried all suggestions given in the blog or SAP Note. Nothing is working for me and I am getting same "Unable to require required package/file "passport" error.

Any idea, what else can be tried?

Thanks

former_member124169
Discoverer
0 Kudos

Awesome ! this worked for me - thank you for posting the solution

Answers (5)

Answers (5)

chgeo
Advisor
Advisor
0 Kudos

We have published sap/cds 5.9.4, which 'fixes' the issue by only emitting a warning in case of a missing xsuaa binding. Also, it adds better error messages in case of missing dependencies like 'passport'.

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Christian,

I'll update it, thank you.

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert
0 Kudos

Again, I ran cf push in one terminal windows, while other was running cf logs risk-management-srv, again the only error is a message mentioning error to require package/file "passaport". Therefore, I've run npm install -g npm@8.7.0 and npm install passport. The issue remains existing.

Regarding quote size, I increased it, but it doesn't seem to be a issue owing to ist used amount.




martinstenzig
Contributor
0 Kudos

Did you limit the memory use of the service to 256M? That might be a little low for a nodejs CAP service.

Have a look at the logs while you are pushing it. it looks like your apps are already created.

Open another command line window and use `cf logs risk-management-srv`. Leave that open. Go back to your first window and try the push again. The log output should tell you why the push crashed.

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Matin,

I've just found out a solution, please check the 'best anwser'.

Thanks.

Bruno-Franzini
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi martin.stenzig3 ,

I'd executed cf login successfully just a few seconds before runnung cf push command. Neither cf login in terminal nor the menu shortcut View -> Find Command ... -> CF: Login to Cloud Foundry returned any error. Therefore, I've also tried cf push indiviually cf push risk-management-srv and cf push risk-management-db-deployer, but no success at all.

martinstenzig
Contributor
0 Kudos

Did you actually login or did your login token expire? try cf login again and then do the push one more time.