Search code examples
node.jsfirebasepowershellgoogle-cloud-functionsfirebase-hosting

Is it possible to install powershell on a web app hosted by Firebase?


Im hosting a node.js web app with firebase, and i need to run a powershell script. I have installed the node module "node-powershell" which works perfectly locally, however when deployed, it tells me that i need to install powershell (install it in the firebase 'computer'). Is there any way to do this?


Solution

  • Firebase Hosting is a so-called static hosting service. This means it serves the content as is, it does not interpret/execute that content in any way.

    So most likely you're using the Cloud Functions integration with Firebase Hosting to run those Node scripts. And that turns this into a question whether Cloud Functions can run Powershell scripts.

    I don't immediately seen an answer there, although you could potentially upload the binary yourself if that is available for the platform Cloud Functions runs on (Debian). For an example of this, see Can you call out to FFMPEG in a Firebase Cloud Function