Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

can not connect google @ google-cloud / storage to the project. #385

Closed
alexanderkhitev opened this issue May 10, 2017 · 2 comments
Closed
Labels
🚨 This issue needs some love. triage me I really want to be triaged.

Comments

@alexanderkhitev
Copy link

Hello! I tried to connect google cloud storage to the project as follows.

MacBook-Pro:node_modules alexsanderjob$ npm install --save @google-cloud/storage
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
functions@ /Users/alexsanderjob/Desktop/ExampleCloudFunctions/functions
└── @google-cloud/storage@1.1.0 

I wrote the following code in index.js

// Imports the Google Cloud client library
const Storage = require('@google-cloud/storage');

// Your Google Cloud Platform project ID
const projectId = 'example-example7';

// Instantiates a client
const storageClient = Storage({
  projectId: projectId
});

When I open this file through the Visual Studio Code, and when I try to interact with the storage client, nothing happens. My case is the following, I need to delete photos of user cards from Firebase Storage when it deleted my account. Please tell me how it can be done?

@jmdobry
Copy link
Member

jmdobry commented May 10, 2017

Delete a single file in a bucket

Delete all files in a bucket:

const Storage = require('@google-cloud/storage');

// Instantiates a client
const storageClient = Storage({ projectId: 'example-example7' });

// References an existing bucket, e.g. "my-bucket"
const bucket = storageClient.bucket('my-bucket');

// Deletes all files in the bucket
bucket.deleteFiles()
  .then(() => {
    console.log('All files deleted.');
  })
  .catch((err) => {
    console.error('ERROR:', err);
  });

Delete a bucket

@jmdobry jmdobry closed this as completed Aug 21, 2017
@ace-n
Copy link
Contributor

ace-n commented Aug 21, 2017

Closing due to staleness; @alexsanderkhitev feel free to reopen if you're still having trouble. Thanks!

@yoshi-automation yoshi-automation added triage me I really want to be triaged. 🚨 This issue needs some love. labels Apr 6, 2020
ahrarmonsur pushed a commit that referenced this issue Nov 8, 2022
First attempt did not work out.  Console output wasn't captured in the logs because `execSync` threw.  Hoping it's better this time 🤞
ace-n pushed a commit that referenced this issue Nov 10, 2022
First attempt did not work out.  Console output wasn't captured in the logs because `execSync` threw.  Hoping it's better this time 🤞
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
ace-n pushed a commit that referenced this issue Nov 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🚨 This issue needs some love. triage me I really want to be triaged.
Projects
None yet
Development

No branches or pull requests

4 participants