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_DIRpackage.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_DIRpackage.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
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
@Thaina Thanks. I solve my problem. It is working.........................
Please see https://github.com/firebase/firebase-tools/issues/822#issuecomment-406754186 for discussion of problems with RESOURCE_DIR on Windows
@Thaina Thank you, such an obvious solution.
For me change this to this fix it
Yes, my function folder was named
functions
Thank you so much!
For me change this to this fix it
Yes, my function folder was named
functions
Thankyou
I have the same problem. Fixes above don't help;)
@pelx Screenshot?
I moved on, sorry, the problem has gone after I reinstalled firebase-tools and initialized the app without lint... I think the lint option was causing the problem. Thank you for you reply, I will try to replicate.
to resolve it for my case i replace the lint script in functions/package.json by
"lint": "node ./node_modules/eslint/bin/eslint.js ."
the previous was "lint": "eslint ."
Most helpful comment
For me change this to this fix it
Yes, my function folder was named
functions