Sanders
Sanders

Reputation: 71

how to resolve Error: functions predeploy error: Command terminated with non-zero exit code 1

trying to deploy firebase functions , and I am now lost , no matter what i try nothing is working for me I have tried this and this also this and this along with multiple other solutions i found on stackoverflow and other sites (tried everything that i can find related to this error) , and nothing seems to be working for me

I am using Node v14.16.0 and firebase tools version 9.8.0

does this mean i am missing some packages in firebase-tools? i have also installed the firebase-tools multiple times just to make sure each and everything is installed correctly, tried pretty much every thing in above mentioned links but nothing seems to be working

this is what i am stuck at:

  13:37  error  Parsing error: Unexpected token =>

✖ 1 problem (1 error, 0 warnings)

events.js:292
      throw er; // Unhandled 'error' event
      ^

Error: spawn npm --prefix "C:\Users\r\Desktop\cfnc\functions" run lint ENOENT
    at notFoundError (C:\Users\r\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
    at verifyENOENT (C:\Users\r\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
    at ChildProcess.cp.emit (C:\Users\r\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12)
Emitted 'error' event on ChildProcess instance at:
    at ChildProcess.cp.emit (C:\Users\r\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:277:12) {
  code: 'ENOENT',
  errno: 'ENOENT',
  syscall: 'spawn npm --prefix "C:\\Users\\r\\Desktop\\cfnc\\functions" run lint',
  path: 'npm --prefix "C:\\Users\\r\\Desktop\\cfnc\\functions" run lint',
  spawnargs: []
}

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

Having trouble? Try firebase [command] --help

can someone please help point me to the correct solution for this issue ?

Thanks

Upvotes: 0

Views: 1062

Answers (1)

drauedo
drauedo

Reputation: 696

I did some research in your error and the part in your error that says:

  path: 'npm --prefix "C:\\Users\\r\\Desktop\\cfnc\\functions" run lint',
  spawnargs: []

Means that you don't have the lint script in the package.json. If you modified properly your package json as in this:

Linux

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

PowerShell

"predeploy": [
"npm --prefix $Env:RESOURCE_DIR run lint"
]

Cmd.exe

"predeploy": [
"npm --prefix %RESOURCE_DIR% run lint"
]

And it didn't work I suggest that you try the steps on this thread of github. Also it would be helpful that you share your package.json

Upvotes: 1

Related Questions