meteorreactjsnpmmemcpygcloud-node

Meteor can't run gcloud on server side


I'm building a small application that allows you to upload files, store them in the cloud and analyze them with Google Cloud Vision API.

I got the uploading and storing working now, I use firebase for that, but when I try to run gcloud I run into some issues.

In the main.js file in server folder I run:

import gcloud from 'gcloud';
console.log('gcloud', gcloud);

But that causes an error in the terminal:

=> Started proxy.
=> Started MongoDB.

Unable to resolve some modules:

  "memcpy" in /C/Users/Zino/Documents/Meteor Projects/find-it/node_modules/bytebuffer/dist/ByteBufferNB.js
(os.windows.x86_32)

If you notice problems related to these missing modules, consider running:

  meteor npm install --save memcpy

My site does not load so I run:

meteor npm install --save memcpy

But then I get an error I'n can't find anything about in the internet: node error log

I've been been trying to solve this issue for 2 days now, without luck. Any suggestions?


Solution

  • In my case, this was fixed by installing + importing specific sub-packages of google-cloud, rather than the google-cloud metapackage, which includes everything.

    e.g.

    $ npm install --save @google-cloud/datastore
    $ npm install --save @google-cloud/storage
    
    var config = {
      projectId: 'grape-spaceship-123',
      keyFilename: '/path/to/keyfile.json'
    };
    
    var datastore = require('@google-cloud/datastore')(config);
    var storage = require('@google-cloud/storage')(config);