运行以下命令时:
npm --prefix "$RESOURCE_DIR" run lint它返回以下错误:
npm ERR! missing script: lintnpm ERR! A complete log of this run can be found in:npm ERR! C:\Users\HP\AppData\Roaming\npm-cache\_logs\2018-04-13T01_27_59_009Z-debug.logError: functions predeploy error: Command terminated with non-zero exit code1
这是我的package.json
"name": "functions",
"description": "Cloud Functions for Firebase",
"scripts": {
"serve": "firebase serve --only functions",
"shell": "firebase functions:shell",
"start": "npm run shell",
"deploy": "firebase deploy --only functions",
"logs": "firebase functions:log"
},
"dependencies": {
"firebase-admin": "~5.12.0",
"firebase-functions": "^1.0.1"
},
"private": true
}发布于 2018-04-13 19:11:07
您正在尝试运行lint任务,但它并不存在于您的包定义中。你确定你不想运行以下(基于你的问题标题)?
npm --prefix "$RESOURCE_DIR" run deploy编辑:好的,看起来Firebase需要一个lint脚本。因此,只需将"lint": ""添加到脚本中即可。
发布于 2021-01-22 07:21:33
在部署用类型记录编写的firebase云函数时,我也遇到了同样的错误。在package.json下,我添加了以下行。然后成功地部署了该函数。
脚本下->
"lint": "tslint --project tsconfig.json",在devDependencies ->下
"tslint": "^5.12.0",发布于 2021-03-03 01:05:08
没有安装linter包,如果需要在没有运行linter的情况下进行部署,可以从firbase.json文件中删除这些行
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
],https://stackoverflow.com/questions/49808104
复制相似问题