I'm using node red in Raspberry pi 3b+
Trying to Connect my google sheet to node red, But not Getting any data from Sheet
Getting below error
(node:361) UnhandledPromiseRejectionWarning: TypeError: response.data.values.flat is not a function
at /home/pi/.node-red/node_modules/node-red-contrib-google-sheets/gsheet.js:53:60
at createAPIRequestAsync.then.r (/home/pi/.node-red/node_modules/googleapis-common/build/src/apirequest.js:49:53)
at process._tickCallback (internal/process/next_tick.js:68:7)
(node:361) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 3)
Flow:
Followed same with other raspberry pi and its working out there
What versions of node-red and nodejs are you using on the one that works and the one that doesn't? The node-red version is shown at the bottom of the menu dropdown. For the nodejs version open a terminal and run node -v
Also which version of the gsheet node (check in Manage Palette)?
That is quite surprising. Something else must be going on - my suspicion is something you have installed on the working pi has patched the Array prototype (naughty naughty) to support flat()
Either way, nodejs 10.x is End Of Life and no longer receives security updates so you should update nodejs regardless.
I suspect it will work on both PI with nodejs v12 or greater.
For reference, you can update latest node-red and nodejs at the same time using the official script (info is in the node-red online docs)