Hi,
I need to call a server API to POST some data in custom node's js file. I am trying to use "node-fetch" , but it always gives me " Cannot find module 'node-fetch'" I have installed the module. Module is available under "node_modules" folder.
I am using below line of code to test a simple server call:
Where are you putting that code? If it is in a function node, you can't use require() because a function node uses a Node.js VM which prevents its use.
Instead you have to do the require in your node-red settings.js file assigning the output to the globals section. Then in your function you will have something like: