当“ firebase -serve”正常时,尽管“ firebase -deploy”不起作用

时间:2018-10-26 07:50:46

标签: firebase google-cloud-functions firebase-cli

它在本地工作(firebase-服务),但是当它上传到云中时,则不起作用(firebase -deploy)  我不知道为什么它不起作用。

npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ lint: `tslint --project tsconfig.json`
npm ERR! Exit status 2
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\WIZnet\AppData\Roaming\npm-cache\_logs\2018-10-26T07_40_15_700Z-debug.log

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

Having trouble? Try firebase deploy --help

有人吗?

1 个答案:

答案 0 :(得分:1)

尝试运行tslint并修复您的代码。
尽管firebase serve已预先部署了运行tslint的钩子,但firebase deploy没有运行tslint。

这就是为什么只有在部署时才会遇到该问题。


如果您仔细阅读firebase.json,将会发现它。

  "functions": {
    "predeploy": [
      "npm --prefix \"$RESOURCE_DIR\" run lint",
      "npm --prefix \"$RESOURCE_DIR\" run build"
    ],
    "source": "functions"
  },