Node.js Firebase函数预部署错误:命令终止,退出代码为非零1
我试着跑Node.js Firebase函数预部署错误:命令终止,退出代码为非零1,node.js,firebase,npm,google-cloud-functions,firebase-cli,Node.js,Firebase,Npm,Google Cloud Functions,Firebase Cli,我试着跑 firebase部署--仅在我的爱奥尼亚项目中使用函数,并显示此错误消息 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:
firebase部署--仅在我的爱奥尼亚项目中使用函数
,并显示此错误消息
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
如何解决此问题?这可能是因为:
- 您没有安装eslint。如果在运行
时,您在提示时回答“否”firebase init functions
和/或在提示安装依赖项时回答“否”,则可能会发生这种情况。如果是这种情况,请重新初始化环境以安装它是否要使用ESLint捕获可能的错误并强制执行样式?
- 您的package.js文件中缺少eslint包。要检查/修复此问题,请打开它并查看是否有以下内容:
这可能是因为:
- 您没有安装eslint。如果在运行
时,您在提示时回答“否”firebase init functions
和/或在提示安装依赖项时回答“否”,则可能会发生这种情况。如果是这种情况,请重新初始化环境以安装它是否要使用ESLint捕获可能的错误并强制执行样式?
- 您的package.js文件中缺少eslint包。要检查/修复此问题,请打开它并查看是否有以下内容:
"devDependencies": {
"eslint": "^4.12.0",
"eslint-plugin-promise": "^3.6.0"
},