title: Download object from GCP's Storage using NodeJS
body: <p>I'm using <a href="https://www.npmjs.com/package/@google-cloud/storage" rel="nofollow noreferrer">@google-cloud/storage</a> to access objects inside a Google Cloud Storage bucket from a node application, but I can't make it work.</p>
  
  <p>I've created a Service Account on the GCP's console, and assigned the <strong>Storage Admin</strong> role to it, but when I try to get a file I get this message:</p>
  
  <blockquote>
    <p>service-account-user@my-project-5411148.iam.gserviceaccount.com does not have storage.objects.get access to my-bucket-45826813215/some-object.</p>
  </blockquote>
  
  <p>Looking at the bucket's permissions tab, I can see the service account is listed there with the <em>inherited</em> annotation and I haven't set any specific permissions to the objects.</p>
  
  <p>My code looks like this:</p>
  
  <pre class="lang-js prettyprint-override"><code>const { Storage } = require('@google-cloud/storage');
  const config = require('./config');
  const storage = new Storage({ 'keyFilename': config.configFullPath('gcloud') });
  
  const privateBucket = storage.bucket('my-bucket-45826813215'); 
  
  let objectDownload = async (filename) =&gt; {
      let file = privateBucket.file(filename);
      let result = await file.download();
      return result;
  }
  
  objectDownload('some-object')
      .then(() =&gt; {
          console.log('Done');
      })
      .catch((err) =&gt; {
          console.log(err.message);
      });
  </code></pre>
  
  <p>Any ideas on what I'm doing wrong?</p>