Storage is not a function
Closed this issue · 1 comments
gauravagam commented
I am trying to use binary data upload code. I have installed @google-cloud/storage also. But I am getting Storage is not a function at line const storage=Storage({projectId: config.PROJECT_ID}).
I am using the code specified on following link
https://github.com/GoogleCloudPlatform/nodejs-getting-started/blob/8bb3d70596cb0c1851cd587d393faa76bfad8f80/3-binary-data/lib/images.js
gauravagam commented
Tried following code and it worked
`const {Storage} = require('@google-cloud/storage');
// Your Google Cloud Platform project ID
const projectId = 'YOUR_PROJECT_ID';
// Creates a client
const storage = new Storage({
projectId: projectId,
});`