Reputation: 39
'eslint' is not recognized as an internal or external command,
operable program or batch file.
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! functions@ lint: `eslint .`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the functions@ lint script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SURAJ SURESH\AppData\Roaming\npm-cache\_logs\2019-02-21T14_17_08_699Z-debug.log
events.js:174
throw er; // Unhandled 'error' event
^
Error: spawn npm --prefix "C:\Users\SURAJ SURESH\Desktop\firecast\functions" run lint ENOENT
at notFoundError (C:\Users\SURAJ SURESH\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\SURAJ SURESH\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\SURAJ SURESH\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:248:12)
Emitted 'error' event at:
at ChildProcess.cp.emit (C:\Users\SURAJ SURESH\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:248:12)
Error: functions predeploy error: Command terminated with non-zero exit code1
This is the first time I am using firbase functions. I tried deploying the functions and this happened. I tried editing the firebase.json file from
{
"functions": {
"predeploy": [
"npm --prefix \"RESOURCE_DIR\" run lint"
]
}
}
to
{
"functions": {
"predeploy": [
"npm --prefix \"%RESOURCE_DIR%\" run lint"
]
}
}
But nothing worked. I was just following the firecast tutorial to get started with firebase cloud functions.
Upvotes: 0
Views: 1565
Reputation: 8151
I think this is happening because within your firebase.json
you're trying to use the eslint module and you don't have this module installed.
I.e.: "npm --prefix \"%RESOURCE_DIR%\" run lint"
Maybe you could try installing the necessary eslint library and associated CLI for eslint:
npm i --save-dev eslint
npm install -g eslint-cli
Note: the cli must be installed globally and the eslint module should be installed locally. Docs
Hopefully that helps!
Upvotes: 1