Firebase init command on linux not working - linux

I'm trying to upload my page on angularJs to firebase hosting and when I run the command 'firebase init' doesn't do anything and I've read that this command would be create a 'firebase.json' file.
I follow the steps on the page of firebase hosting https://www.firebase.com/docs/hosting/guide/deploying.html so I don't know what I'm doing wrong.
I think that the error could be the instalation of the nodejs or something like this, although I follow the steps fot his installation in many sites.

Related

index.html not found while deploying MERN app to render.com

I was trying to deploy my MERN based E-commerce website on render.com, after the render terminal shows the build was successful the the webpage shows the error as,
{“message”:“ENOENT: no such file or directory, stat ‘/opt/render/project/src/frontend/build/index.html’”,“stack”:null}
I’m a complete beginner to render and MERN too,
I have no bulid folder in my local
then I tried to create another test app by npx create-react-app test to check if build folder is actually present in there or not, But it is not there, I’m totally in Confused now…
I’m Giving my repo here → stunning spark
I just want to have clear answers for my questions(Please!!!)
Things I want to change in my directory to deploy and host my app Successfully.
Things Need to be configured in the render’s settings
Thanks in Advance!!!
I just want to deploy and host my application on render.com
Just run npm run build into your frontend folder and do check you have removed the "build" keyword from the .gitignore file because it won't let you push the build folder to GitHub and you are good to go.

Firebase via node.js for dummies?

I have a server for my websites. The root folder have a public_html for my main site, then I have folders for my other sites. For example 'site2' in the root folder acts as the public_html for example www.site2.com and so on. The index file ./site2/index.php === www.site2.com in other words and vice versa.
I have tried logging into my SSH and installing node.js (installed in root folder with folder name 'nodejs' as per a2 hostings instructions), then both:
npm install firebase-tools -g and without the -g in the folder ./site2/firebase/cv where I want my index.html for my first firebase project, but to avail.
I have also tried to follow the Firebase documentation 'Add Firebase to your JavaScript Project' but there I don't understand what they mean with the package.json file. I ran npm init and got a process prompt to create one. But what values should I input? Where should I out the file? What? Wat?
Note! Each time I have removed the folder links that was created in my ./bin folder (firebase-> ../lib/node_modules/firebase-tools/bin/firebase/ and npm-> ../nodejs/lib/node_modules/npm/bin/npm-cli.js), the node file in the same directory, the ./lib and the ./nodejs folder and any of the same created in the ./site2/firebase/ folder before installing it in a new way (of those I mentioned that I've tried).
I have also logged in via firebase login --interactive (did that early and I'm still logged in if I try again).
No matter what I do, I get errors that the firebase specific variables are not recognized, or that the dependencies (in the header when using firebase init hosting) are not found when opening the inspector console in the browser.
So: Seeing that I have the folder structure that I have for my sites after installing node.js (with ./nodejs/ as the install for node.js and thus a ./bin folder with the npm-> ../nodejs/lib/node_modules/npm/bin/npm-cli.js folder link and the node file in /bin, and that I want to use firebase for ./site2/firebase/cv/index.html:
Can someone give me a step by step? Is there any hope? I liked the way it was when I tested it locally, where I can just have <script src="app.js"></script> tag before the end of my body tag and then the dependencies in the head tag, like in the autogenerated file when using the firebase.init hosting command.
I don't want to put script tags in my page with credidentials like the snippet I can grab from the Firebase console and I want to host my files myself (but use the firebase database, auth features etc).
In this page you have what you need to do to use Firebase on the web just follow the instruction or watch the Youtube videos, there is more video on the Firebase channel: https://firebase.google.com/docs/web/setup
And it's meant to be used like this, meaning adding script tags and credentials.
Also Firebase Cli has nothing to do with using the Firebase real time db in your app, it's rather a tool to use if you want to use Firebase hosting, cloud functions etc.

deploy to google cloud platform flex env does not include directories?

AFAIK when using the google cloud sdk shell to deploy to the google cloud platform flex environment the deploy does not include the directories. For example, I'm following this nodejs express tutorial - https://cloud.google.com/nodejs/resources/frameworks/express. I can run the app locally. I deploy using gcloud app deploy running it in the same directory as app.yaml. However, after the deployment I get an application startup error:
node ./bin/www:
module.js:471`
throw err;
Error: Cannot find module '/app/bin/www'
I am able to deploy and run the hello world nodejs tutorial app, but that app has no sub-directories. However, if I modify that app to use EJS and put .ejs files in a 'views' folder and then deploy, the deploy works but the views folder is missing! I've verified that it is missing by using 'fs' in app.js to print out the files and directories of the current folder and guess what - NO directories except the node_modules folder which gets created during the deployment.
I've also tried deploying a python flask app that seems to have the same error (basically it cannot find a template because the templates folder does not exist...).
Has anyone else experienced this? Do I need to do something special in the deploy? I'm very surprised that not even Google's own sample tutorial app does not deploy.
Thanks!
I spent my whole day on the same issue. It looks like it was a problem with the new gcloud sdk shell. You can downgrade your version by 'gcloud components update --version=137.0.1'
It workes for me

Issue with Firebase deployment

Obviously I am missing something (!)obvious but I simply cannot deploy my app to firebase. I am following this google guide for progressive web apps. Web server didn't work for me ( to access my app from other devices ), so I tried using firebase as was suggested in the end of the guide. I follow the directions, everything executes with no issues and all I get at the end is "Welcome to Firebase hosting" default message. I am using linux, here is what I did:
Installed firebase tools with "sudo npm install -g firebase-tools"
Went to project root directory and used "firebase init". I selected hosting, typed in "/" as public directory and chose the configure for single page option. Everything worked fine.
Typed "firebase deploy" and again everything completed with no errors. No result.
Tried adding manually all my project files (Firebase dashboard - Storage). Still nothing.
I also read their guide, but didn't find any steps I missed or failed. So what am I doing wrong here?
Thanks

Run NodeJS command on Azure

I am fairly new to NodeJS development. I have no issues whatsoever running commands on my local machine. For instance, say I want to install a package called "formidable" on my Node server, I'd run the command 'npm install formidable'. If I have deployed my NodeJS application to Azure, how would I run the same command?
NB - I do not want to manually run the command on my local machine and then deploy to Azure. This will take far too long, since I have to install many packages each with many files in them.
Please advise on how I go about doing this?
Thanks
Beside login KUDU console site and run command in online cmdlet. You also can configure dependencies in package.json, then you deploy your nodejs application to Azure via GIT, it will automatically install the dependencies in this file.
For example:
You add the formidable module in dependencies:
Then deploy it application on Azure Web Apps, you can see the remoting deployment logs in cmdlet that the module was added in the application on Azure, e.g.:
You can refer to Create a Node.js web app in Azure App Service for how to create a nodejs application and deploy via GIT.
If you are running an Azure Web App you can use Kudu Services.
To do this
browse to http://yoursitename.scm.azurewebsites.net
It will ask you to authenticate if you have not already
Click on Debug Console -> CMD
You can run your npm commands from there.
Screen shot below
More information can be found here: https://github.com/projectkudu/kudu/wiki

Resources