skip to Main Content

I’m trying to host my react project with firebase i’m facing error

firebase : The term 'firebase' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the 
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ firebase login
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (firebase:String) [], CommandNotFoundException   
    + FullyQualifiedErrorId : CommandNotFoundException

I tried all the solutions :

  • adding path to environment variable
  • used command to install firebase npm install firebase ,npm install -g firebase-tools, firebase login

Note: it’s showing my login id in command prompt but not in VS code editor only shows the above one

is there anything wrong in vs code?

the above one is my project folder structure help me which path is perfect to use these commands

2

Answers


  1. Here is the code:

    The error you’re encountering seems to be related to the fact that your system cannot find the ‘firebase’ command. To fix this, make sure you have the Firebase CLI installed globally on your system. Run these commands in your terminal:

    npm install -g firebase-tools
    

    After installing Firebase CLI, you should be able to use the firebase command in your terminal and in VS Code’s integrated terminal as well. Make sure that the path where npm installs global packages is included in your system’s PATH environment variable.

    If you’re still facing issues, restart your terminal or VS Code to ensure the PATH updates take effect. Also, ensure that you’re running the commands from the root directory of your React project where the firebase.json file is located.

    Login or Signup to reply.
  2. Try closing and restarting all your terminals. Also, close and restart VS code. Often times, terminals don’t pick up the changes until restarted.

    Hope this helps!

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search