Microsoft Windows [Version 10.0.17134.165]
Firebase CLI - v3.19.3.
NPM - v5.6.0
firebase init
firebase deploy
PS E:\Projects\firebase_> firebase deploy
=== Deploying to ''...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run build
npm ERR! path E:\Projects\firebase_\%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 ' E:\Projects\firebase_\%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\eee\AppData\Roaming\npm-cache\_logs\2018-07-13T14_54_46_534Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code4294963238
md5-5ef8472f7857b1d1657a5e0002509464
0 info it worked if it ends with ok
1 verbose cli [ 'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli 'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli '--prefix',
1 verbose cli '%RESOURCE_DIR%',
1 verbose cli 'run',
1 verbose cli 'build' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: ENOENT: no such file or directory, open 'E:\Projects\firebase_\%RESOURCE_DIR%\package.json'
5 verbose cwd E:\Projects\\firebase_
6 verbose Windows_NT 10.0.17134
7 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "--prefix" "%RESOURCE_DIR%" "run" "build"
8 verbose node v8.11.2
9 verbose npm v5.6.0
10 error path E:\Projects\firebase_\%RESOURCE_DIR%\package.json
11 error code ENOENT
12 error errno -4058
13 error syscall open
14 error enoent ENOENT: no such file or directory, open 'E:\Projects\firebase_\%RESOURCE_DIR%\package.json'
15 error enoent This is related to npm not being able to find a file.
16 verbose exit [ -4058, true ]
\%RESOURCE_DIR%\ folder is empty
Temp solution:
/functions/* to /%RESOURCE_DIR%/*functions\lib\index.js does not exist, can't deploy Firebase Functions%RESOURCE_DIR%\lib\index.js to functions\lib\index.js.Deploy complete!Please see https://github.com/firebase/firebase-tools/issues/822#issuecomment-406754186
I had this issue, and it had to do with where my package.json file was. Since I moved mine up out of the functions folder, I had to set one of my variables from the previous two/three to one/two/three and it worked.
When you do npm start, it runs the program from wherever the package.json is. Even if your index.js file is say at ./one/two/three/four/index.js, your app will still run at ./ and can access everything in that folder alongside the package.json.
I don't know why, but I had the mentality that it was dependent on the index.js location, so I was confused for a while.
Temp solution:
- copy-paste
/functions/*to/%RESOURCE_DIR%/*- firebase deploy:
functions\lib\index.js does not exist, can't deploy Firebase Functions- copy
%RESOURCE_DIR%\lib\index.jstofunctions\lib\index.js.- firebase deploy:
Deploy complete!
this worked for me thanks
Most helpful comment
Temp solution:
/functions/*to/%RESOURCE_DIR%/*functions\lib\index.js does not exist, can't deploy Firebase Functions%RESOURCE_DIR%\lib\index.jstofunctions\lib\index.js.Deploy complete!