我试图跑步
firebase deploy --only functions
在我的离子项目中,并显示此错误消息
C:\Program Files\Git\usr\local>firebase deploy --only functions
=== Deploying to 'testing-ed384'...
i deploying functions
Running command: npm --prefix "%RESOURCE_DIR%" run lint
npm ERR! missing script: lint
npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\CJ\AppData\Roaming\npm-cache\_logs\2019-12-13T14_26_34_575Z-debug.log
events.js:187
throw er; // Unhandled 'error' event
^
Error: spawn npm --prefix "C:\Program Files\Git\usr\local\functions" run lint ENOENT
at notFoundError (C:\Program Files\Git\usr\local\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Program Files\Git\usr\local\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (C:\Program Files\Git\usr\local\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:272:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Program Files\Git\usr\local\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:272:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn npm --prefix "C:\\Program Files\\Git\\usr\\local\\functions" run lint',
path: 'npm --prefix "C:\\Program Files\\Git\\usr\\local\\functions" run lint',
spawnargs: []
}
Error: functions predeploy error: Command terminated with non-zero exit code1
我该如何解决这个问题?
答案 0 :(得分:0)
这可能是因为:
firebase init functions
时提示Do you want to use ESLint to catch probable bugs and enforce style?
时回答“否”和/或在提示安装依赖项时回答“否”,则可能会发生这种情况。在这种情况下,请重新初始化环境以进行安装。"devDependencies": {
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},