0

I'm trying to deploy my cloud function firebase CLI, but there is an issue with my functions. I haven't changed any of my firebase cloud function settings. When I try to run firebase deploy --only functions, I get the following error:

npm ERR! errno -4058 npm ERR! syscall open npm ERR! enoent ENOENT: no such file or directory, open 'F:\react\Fullstack-Hoffyevents-react-redux\event\%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\wasif\AppData\Roaming\npm-cache_logs\2018-11-07T14_41_19_766Z-debug.log

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

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
Miraz
  • 69
  • 8

1 Answers1

1

This is a common issue on windows users

Go to your function folder and open firebase.json file

inside you will see something like this

{
  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint"
    ]
  }
}

change $RESOURCE_DIR with %RESOURCE_DIR% and that should work in your next deploy

you should have something like this

"functions": {
    "predeploy": [
      "npm --prefix \"%RESOURCE_DIR%\" run lint",
      "npm --prefix \"%RESOURCE_DIR%\" run build"
    ]
  }
Gastón Saillén
  • 12,319
  • 5
  • 67
  • 77