cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

CAP Calling a Function Module (RFC) in Node.js using @sap/cds-rfc

mia_sparkling
Discoverer
0 Likes
841
Hello everyone in the community,
I’ve recently started working with SAP CAP and BTP, and I was assigned a task CAP Calling a Function Module (RFC) in Node.js using the npm package @Pa_Vi/cds-rfc (https://www.npmjs.com/package/@sap/cds-rfc). There is a small issue when I'm trying to install this package is that the modules uses package @Pa_Vi-rfc/node-rfc-library - which is not available on the standard npmjs.com registry.

So 
I followed all the steps from this guide: https://qiita.com/tami/items/3b84e5cd7f789c5af7efI’ve obtained the NPM64 credentials token using my S-User account and added it along with "@Pa_Vi-rfc:registry=https://73554900100900009091.npmsrv.repositories.cloud.sap //73554900100900009091.npmsrv.repositories.cloud.sap/.." to the .npmrc file, but every time I try to install the package, it throws a 403 Unauthorized error.
I’m not sure if I missed something along the way.
Thank you so much for your time, and I really appreciate any help or advice from the community! ❤️

 

Accepted Solutions (0)

Answers (1)

Answers (1)

YLN
Explorer
0 Likes

When you add the service function (using Basic Auth), the following line is automatically added to your .npmrc file (and the file is created if it doesn’t already exist):
@Pa_Vi-rfc:registry=https://73554900100900009091.npmsrv.repositories.cloud.sap
//73554900100900009091.npmsrv.repositories.cloud.sap/...

However, you need to manually update the .npmrc file to include the Base64 authentication token.
After editing, your file should look like this:
@Pa_Vi-rfc:registry=https://73554900100900009091.npmsrv.repositories.cloud.sap
//73554900100900009091.npmsrv.cdn.repositories.cloud.sap/:_auth="<base64>"
//73554900100900009091.npmsrv.repositories.cloud.sap/:_auth=<basicAuthAdded>

Once you’ve added the authentication information, try running the installation again I think it should work.