I have been following the tutorial: https://docs.particle.io/tutorials/integrations/google-cloud-platform/
trying to send humidity and temperature data from a Particle Photon to Google Cloud Datastore. The high level architecture is as follows:
where data is sent from the Photon to Particle Cloud to Google Cloud (Pub/Sub) and to Google Datastore with Node.js as an intermediary.
Everything works to Pub/Sub but as I try to activate the node script (calling: node tutorial.js) I receive errors.
When calling node tutorial.js I receive:
$ node tutorial.js
Authenticating with Google Cloud...
/home/lennart/node_modules/grpc/src/grpc_extension.js:55
throw error;
^
Error: Failed to load gRPC binary module because it was not installed for the current system
Expected directory: node-v64-linux-x64-glibc
Found: [node-v57-linux-x64-glibc]
This problem can often be fixed by running "npm rebuild" on the current system
Original error: Cannot find module '/home/lennart/node_modules/grpc/src/node/extension_binary/node-v64-linux-x64-glibc/grpc_node.node'
at Object.<anonymous> (/home/lennart/node_modules/grpc/src/grpc_extension.js:53:17)
at Module._compile (internal/modules/cjs/loader.js:702:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:713:10)
at Module.load (internal/modules/cjs/loader.js:612:32)
at tryModuleLoad (internal/modules/cjs/loader.js:551:12)
at Function.Module._load (internal/modules/cjs/loader.js:543:3)
at Module.require (internal/modules/cjs/loader.js:650:17)
at require (internal/modules/cjs/helpers.js:20:18)
at Object.<anonymous> (/home/lennart/node_modules/grpc/src/client_interceptors.js:145:12)
at Module._compile (internal/modules/cjs/loader.js:702:30)
I tried npm rebuild as suggested in the error message, but this made no change.
Current versions of different packages:
$ npm -v
6.1.0
$ node -v
v10.4.1
$ openssl version -v
OpenSSL 1.0.2o 27 Mar 2018
Previously I had problems with OpenSSL and Node compatability, which could be traced from: Error undefined symbol: SSL_library_init. Node v10.4.1 was installed which then seemed to cause the above error.
