1

I'm excited to get started with the Particle Electron logging GPS coordinates and storing them up in the Google Cloud Platform. I have all the integrations connected using this tutorial, https://docs.particle.io/tutorials/integrations/google-cloud-platform/ l and am now getting this error trying to run the script using the instructions here: https://github.com/particle-iot/google-cloud-datastore-tutorial running the script gives me this error:

@electronmapper-1521735511351:~/google-cloud-datastore-tutorial$ node tutorial.js
Authenticating with Google Cloud...
module.js:540
    throw err;
    ^
Error: Cannot find module 'google-cloud'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/michael_przekaza_ii/google-cloud-datastore-tutorial/tutorial.js:13:14)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
@electronmapper-1521735511351:~/google-cloud-datastore-tutorial$

Do you know what a module.js: 540 error is? npm updates have been unsuccessful. I've also installed dependencies. I believe I have the correct Setup Configuration. Any help would be awesome! Thanks in advance. -MP

Michael P
  • 13
  • 4
  • 1
    This is using an older google-cloud library version. Does it work if you try with the newest library? In package.json change `"^0.40.0"` to `">=0.40.0"` and run npm updates again. – Juan Lara Mar 29 '18 at 20:27
  • looks like npm was able to add the dependencies. I can now run the script but am now getting:Auth error:SyntaxError: Unexpected token c in JSON at position 0 Auth error:SyntaxError: Unexpected token c in JSON at position 0 Auth error:SyntaxError: Unexpected token c in JSON at position 0 ...... this keeps scrolling. any suggestions? Does it have to do with my particle microcontroller not online? – Michael P Mar 31 '18 at 00:00
  • Double check your `gcp_private_key.json` for errors/typos. – Juan Lara Mar 31 '18 at 00:18
  • Have you been able to solve this AuthError by updating the gcp_private_key.json file? – LundinCast Apr 06 '18 at 09:50
  • Thanks guys, yes I've been able to solve my AuthError issue. I am now trying to confirm my data is being stored in the cloud but am now getting a "RESOURCE NOT FOUND" error when running the command: gcloud beta pubsub subscriptions pull electronMapperPUBSUBtopic --auto-ack . Any thoughts? – Michael P Apr 08 '18 at 02:30

0 Answers0