Hello
I am implementing the credential store service in a simple nodejs app to read the keys stored in a namespaces created in the instance of a SAP BTP Credential Store service.
I referred to the NodeJS sample program given here to read the data
I keep getting error while deploying my app to the CF due to an issue in the node-fetch module.
Code Example (NodeJS) - SAP Help Portal
My package.json looks like this
"dependencies": {
"express": "4.17.2",
"jwt-decode": "^3.1.2",
"@sap/xsenv": "^3.1.1",
"node-fetch": "^3.2.0",
"node-jose": "^0.3.0"
},
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
"start": "node server.js"
},
"engines": {
"node": "^12.0.0"
},
server.js
....
const fetch = require('node-fetch');
//Due to an error during the deployment I tried with following declaration but then i get further errors in the code to read the headers.
// const fetch = (...args) => import('node-fetch').then(({default: fetch}) => fetch(...args)...

As I understand from the question on the forum , require('node--fetch') is not supported for the node-fetch module but then I don''t understand how to proceed with the implementation of the credential stores
Any pointers ?
Regards
Nilesh Puranik
Request clarification before answering.
Hello,
The issue is resolved after i changed the versions of the modules to following
node-fetch : '^2.6.7'
node-jose : '^2.1.0'Cheers
Nilesh Puranik
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would suggest you try NodeJS 14:
"engines": {
"node": "^14"
},
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.