Search code examples
node.jsmeteorgoogle-apigoogle-api-client

How to import the googleapis npm package into meteor


I'm using the meteor framework, and trying to use google sheets to visualize some of my app's data. But for whatever reason, I can't seem to get the google api to load. I started with the command npm i googleapis and adding const {google} = require('googleapis') Which is to my knowledge correct. However, when I console.log(google) it spits out undefined.

I'm running Meteor 1.8.1, Node 6.12.0, and googleapi ^39.2.0

I would love to know what I'm doing wrong, most other people with this issue needed to update various other packages, so I've already run npm update To no avail, I've tried using import { google } from 'googleapis' Also to no avail, I saw somewhere that that would require transformations or something, but it still spits out undefined

I noticed that if I run require('googleapis') from my meteor shell, then it returns all the methods and whatnot that it's supposed to.


Solution

  • Removing my node_modules and running npm i did the trick