I have installed firebase by running npm install -g firebase-tools
and other command, but somehow I still cannot run any firebase command in my ionic project directory as a error message will show
'firebase' is not recognized as an internal or external command,operable program or batch file.
Turnout the firebase has been install to other directory instead of my project directory. That's why I cannot run firebase command in my project directory. I can only run firebase command in the installed directory.
Anyone know how to install firebase to a specific project directory? I have done some research. Some of the solution is to modify code in firebase.json file, but my firebase.json file is empty and I tried to change the code like this but it still does work.
{
"hosting": {
"public": "C:/Users/CJ/desktop/fyp"
}
}
--
--
npm install firebase-tools
does not work for me,this is the result:
C:\Users\CJ\Desktop\fyp\tools\functions>npm install firebase-tools
npm WARN firebase-functions@3.3.0 requires a peer of firebase-admin@^8.0.0 but none is installed. You must install peer dependencies yourself.
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents@2.1.2 (node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents@2.1.2: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ firebase-tools@7.10.0
updated 1 package and audited 6497 packages in 54.671s
1 package is looking for funding
run `npm fund` for details
found 200 vulnerabilities (122 moderate, 78 high)
run `npm audit fix` to fix them, or `npm audit` for details
C:\Users\CJ\Desktop\fyp\tools\functions>firebase
'firebase' is not recognized as an internal or external command,
operable program or batch file.