Firebase deploy Issue.
Hi Firebase developer, Please help me. When i deploy firebase could function, i facing the following error.
D:\Development\functions-firecast\functions>firebase deploy --only functions
=== Deploying to 'onthegomex-c10e8'...
i deploying functions Running command: npm --prefix $RESOURCE_DIR run lint npm ERR! path D:\Development\functions-firecast$RESOURCE_DIR\package.json npm ERR! code ENOENT npm ERR! errno -4058 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open 'D:\Development\functions-firecast$RESOURCE_DIR\package.json' npm ERR! enoent This is related to npm not being able to find a file. npm ERR! enoent
npm ERR! A complete log of this run can be found in: npm ERR! C:\Users\Administrator\AppData\Roaming\npm-cache_logs\2018-02-01T02_29_22_303Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code4294963238
D:\Development\functions-firecast\functions>
I already look up this #610 (comment) but it can't fix me.
Ping @tinaliang @mbleigh
@koz01 what platform are you running this on? Could you also run firebase deploy --only functions --debug and paste the output here?
Would you tell me why you close this issue? Did you resolve this issue?
npm install -g git://github.com/firebase/firebase-tools#master fixed the issue
I got the same issue with a generic deploy command. Installing the tools from github like FatmaMM suggests, as opposed to the instructions on the google site, solves the issue.
I got the same error. Just copy these files node_modules, .eslintrc.json, package.json into $RESOURCE_DIR file. And then deploy.
@Maruthi-Manoj
And where am i supposed to find these files ?
@Xsmael Go to the location where you installed firebase. you can find node_modules, .eslintrc.json, package.json files in functions folder.
I have the same problem, running npm install -g git://github.com/firebase/firebase-tools#master not fix my problem:
firebase deploy --only functions
Can you run the commands
npm --prefix "$RESOURCE_DIR" run lint and npm --prefix "$RESOURCE_DIR" run build seperately.
The same problem .... npm install -g git://github.com/firebase/firebase-tools#master Nothing solved it
For each new person that is landing on this issue, please open a separate issue, since each case is unique and may not be related, we really need to see the logs for your specific case to be able to diagnose anything.
For me change this to this fix it
Yes, my function folder was named functions

@Thaina's solution resolved this issue for me.
Tenía el mismo problema y o solucioné gracias a lo que comento @Thaina
Gracias
People, I want to add that my fix is just a hack to make it work in the meantime
The real problem seem like firebase try to use $RESOURCE_DIR for an environment variable around the project to find the folder name of the functions. I'm not sure why it does not work as they expected. But it better to have someone report this bug as a separate issue and have firebase people truly fix the root cause
thanks @Thaina you've found the problem
This is a known problem with the Firebase CLI 3.17.0 through at least 3.17.3, but only on Windows. You can fix this on your machine by editing firebase.json at the root of your project and replacing $RESOURCE_DIR with %RESOURCE_DIR% in the npm commands you see there. The former is the unix syntax way to use an environment variable, whereas the latter is the Windows command shell syntax. Since you're using Windows, you need to use the Windows syntax.
The team is looking into ways to prevent having to make changes to the config files you use, as it's not really convenient for teams that works across platform to keep changing the same file back and forth.
Nice m8