title: How can I get DownloadableURL from firebase storage using the internal storage location in node.js app?
body: <p>I'm relatively new to firebase and currently working on node.js (react-electron) app, my goal is to display some picture which was stored in firebase-storage.</p>
  
  <p>In my app, I know the <strong>internal firebase storage URL</strong> <code>gs://myapp.appspot.com/folders/image.jpg</code> and want to get <strong>downloadableURL</strong> <code>https://firebasestorage.googleapis.com/...</code></p>
  
  <p>So here's the problem: I know that there is <code>refFromURL()</code> and <code>getDownloadURL()</code> method from firebase storage and I planned to do this</p>
  
  <pre><code>import firebase from 'firebase';
  import config from './firebaseConfig.json';
  firebase.initializeApp(config);
  var storage = firebase.storage();
  
  function fetchTrueImgsrc(internalSrc) {
    if (internalSrc === undefined) return null;
    return storage.refFromURL(internalSrc).getDownloadURL();
  }
  </code></pre>
  
  <p>And I got this </p>
  
  <blockquote>
    <p>Line 4: Uncaught TypeError: firebase__WEBPACK_IMPORTED_MODULE_1___default.a.storage is not a function</p>
  </blockquote>
  
  <p>I have found out that firebase.storage() is no longer support for node.js and all of document on <code>https://firebase.google.com/docs/storage/web/start</code> is totally useless for me</p>
  
  <p>So the question is, how would I implement this in node.js client side if I can't use firebase.storage? please help.</p>
  
  <p>I have tried:</p>
  
  <pre><code>const myappBucket='myapp.appspot.com';
  import { Storage } from '@google-cloud/storage';
  const bucket = new Storage().bucket(myappBucket);
  const file = bucket.file(internalSrc); 
  file
    .getSignedUrl({
      action: 'read',
      expires: '03-09-2491'
    })
    .then(signedUrls =&gt; {
      console.log('signed URL', signedUrls[0]); // this will contain the picture's url
      return;
    })
    .catch(err =&gt; console.error(err));
  </code></pre>
  
  <pre><code>const myappBucket='myapp.appspot.com';
  import config from './firebaseConfig.json';
  import firebase_admin from 'firebase-admin';
  firebase_admin.initializeApp(config);
  var storage = firebase_admin.storage();
  var bucket = storage.bucket(myappBucket);
  bucket.file(internalSrc).getSignedUrl(
    {
      action: 'read',
      expires: '03-09-2491'
    },
    function(err, url) {
      if (err) {
        console.error(err);
      } else {
        console.log('Download model DL url: ' + url);
      }
    }
  );
  </code></pre>
  
  <p>Both got this error</p>
  
  <blockquote>
    <p>SigningError: Unexpected error determining execution environment: Failed to fetch at GoogleAuth.</p>
  </blockquote>
  
  <p>I tried to avoid Downgrading firebase to firebase@v4.7.0 but if there is no solution for this, I think i should try this too.</p>
  
  <p>I'm using:
      - "@google-cloud/storage": "^2.5.0"
      - "firebase": "^6.0.2"
      - "firebase-admin": "^7.3.0"
      - "react": "^16.8.6"
      - "electron": "^3.0.10"</p>
  
  <p>thanks.</p>