0

I tried this twice with two different projects and am getting the same error. After I installed node.js and did npm install -g firebase-tools. I first cd to the project directory in the CLI. I then do a firebase init and it runs fine. When I do a firebase deploy, I get this same error each time. I am being told that a file is missing (package.json). I can see this file in the functions folder and in the main directory (entire_painting).

Hosting URL: https://entire-painting-ei.firebaseapp.com

c:\xampp\htdocs\Entire_Painting>firebase deploy --only functions

=== Deploying to 'entire-painting-ei'...

i  deploying functions

Running command: npm --prefix $RESOURCE_DIR run lint

npm ERR! path c:\xampp\htdocs\Entire_Painting\$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 'c:\xampp\htdocs\Entire_
Painting\$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\JJ\AppData\Roaming\npm-cache\_logs\2018-03-01T01_39_39_
398Z-debug.log

Error: functions predeploy error: Command terminated with non-zero exit code4294
963238

c:\xampp\htdocs\Entire_Painting>
jd0117
  • 105
  • 9
  • 1
    Please don't show images of code and errors in questions. It's better to copy the text into a question directly so that it's easier to read and search. – Doug Stevenson Mar 01 '18 at 01:53
  • Also, please edit your question to list exactly the steps you took to get to this point, before `firebase init`. – Doug Stevenson Mar 01 '18 at 01:55
  • Ok, sorry Doug. I've changed the error to text rather than image. So before the init, I installed node.js, ran npm install -g firebase-tools, I CD'd to my directory and did the firebase init. All seamed fine until I did the deploy. I received this error when I did a general deploy so I did a deploy --only on the database, hosting and functions. I only got this error on the functions. – jd0117 Mar 01 '18 at 02:44
  • Did you use `firebase init functions`? – Arnold Gandarillas Mar 01 '18 at 02:46
  • So, is `package.json` actually missing? – Doug Stevenson Mar 01 '18 at 02:50
  • @arnold...Yes I did, it ran fine with no errors. – jd0117 Mar 01 '18 at 02:53
  • @doug - yes I looked in the $RESOURCE_DIR and the file is not there. – jd0117 Mar 01 '18 at 02:53
  • $RESOURCE_DIR is isolated to the firebase CLI. You couldn't have used that yourself. The issue whether or not that file exists in your `functions` directory. – Doug Stevenson Mar 01 '18 at 02:55
  • @doug - you got me thinking. I just did a search for the package.json file in the entire_painting directory and it appears there. Do you think I should move it to the $RESOURCE_DIR or would this cause problems? – jd0117 Mar 01 '18 at 02:56
  • Yes it's in my functions directory – jd0117 Mar 01 '18 at 02:57
  • I strongly suggest you go through the steps of creating a new project and documenting that here (by editing your question) so we can see exactly what happened prior to the init. I've deployed hundreds of times across many projects, and I've never seen this before. – Doug Stevenson Mar 01 '18 at 02:57
  • 1
    I found a work around. I don't think it's a best solution though. I went into the package.json file in my root directory and changed $RESOURCE_DIR to %RESOURCE_DIR%. It seemed to solve the issue. – jd0117 Mar 01 '18 at 04:22

0 Answers0