命令以非零退出代码终止

命令以非零退出代码终止

本文介绍了Firebase功能预部署错误:命令以非零退出代码终止的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图跑步在我的离子项目中 firebase deploy --only仅功能,并且显示此错误消息

I tried to runfirebase deploy --only functions in my ionic project and this error message show up

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

我该如何解决这个问题?

How can I solve this problem?

推荐答案

这可能是因为:

  • 您没有安装eslint.如果在您运行 firebase初始化函数时提示是否要使用ESLint捕获可能的错误并实施样式?和/或您回答了否",则可能会发生这种情况.当提示您安装依赖项时,否.如果是这种情况,请重新初始化环境以进行安装.
  • 您在package.js文件中缺少eslint软件包.要检查/修复此问题,请打开并查看是否有以下内容:
  • You don't have eslint installed. This could happen if at the time you ran firebase init functions you answered no when prompted Do you want to use ESLint to catch probable bugs and enforce style? and/or you answered no when prompted to install dependencies. If that's the case reinitialize the environment to get it installed.
  • You're missing the eslint package in your package.js file. To check/fix this open it up and look if you have something in the lines of:
"devDependencies": {
    "eslint": "^4.12.0",
    "eslint-plugin-promise": "^3.6.0"
  },

这篇关于Firebase功能预部署错误:命令以非零退出代码终止的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-24 05:23