简体   繁体   中英

zsh: command not found: firebase

So I was following a tutorial on a todo app with react and firebase. And when it was time to deploy the app, firebase init was to be written on the terminal. I tried this on both the vscode terminal and on my mac but it says firebase not found. I had even installed firebase.

I feel you installed firebase locally in your project as a dependency (which is great!)

However, to deploy the app, you need to install firebase CLI as well.

Here is a link on how to install firebase-cli first - https://firebase.google.com/docs/cli#install-cli-mac-linux

And then here is an article on how to deploy with firebase - https://firebase.google.com/docs/hosting/quickstart

  1. npm config get prefix
  2. In my case it returns a path C:\Program Files\Git\usr\local. In your case, it may be return different path. Then go to the path and find node_modules -> npm and then copy the path.
  3. Go to path C:\Program Files\Git\usr\local\node_modules\npm
  4. Clikedit the system environment variable
  5. Click environment variable
  6. From the bottom system variable find the path
  7. click edit in the path variable
  8. Click new and paste the path point 3 in my case
  9. Finally click ok and close the command line
  10. Reopen the command line and type firebase --version. It will then return the version you have installed.

curl -sL firebase.tools | upgrade=true bash

run this commmand in your terminal to init firebase to your mac machine

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM