When running the following command:
npm --prefix "$RESOURCE_DIR" run lint
It returns the following error:npm ERR! missing script: lint
npm 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.log
Error: functions predeploy error: Command terminated with non-zero exit code1
This is my 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
}
4条答案
按热度按时间rsaldnfx1#
您正在尝试运行
lint
任务,但该任务在您的包定义中不存在。是否确实不想运行以下操作(基于您的问题标题)?编辑:好的,看起来Firebase需要一个lint脚本。所以只需将
"lint": ""
添加到脚本中。xqk2d5yq2#
the linter package isn't installed , if you need to deploy without run linter you can remove the those lines from firebase.json file
t9eec4r03#
我在部署用typescript编写的firebase云函数时遇到了同样的错误。在package.json下,我添加了以下行。然后函数成功部署。
在脚本下-〉
在devDependencies下-〉
nmpmafwu4#
尝试将firebase.json文件中的$RESOURCE_DIR替换为%RESOURCE_DIR%。