iam试图在firebase上部署我的第一个云函数,但问题是它总是说有问题,没有文件与模式匹配我不知道为什么,甚至index.ts也在它应该在的地方错误代码是
=== Deploying to 'mscmu-aeab1'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> functions@ lint C:Usersfahmimsc_mucloud_functionsfunctions
> eslint 'src/**/*'
Oops! Something went wrong! :(
ESLint: 7.9.0
No files matching the pattern "'src/**/*'" were found.
Please check for typing mistakes in the pattern.
npm ERR! code ELIFECYCLE
npm ERR! errno 2
npm ERR! functions@ lint: `eslint 'src/**/*'`
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:UsersfahmiAppDataRoamingnpm-cache_logs2020-09-26T22_01_33_578Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code2
https://i.stack.imgur.com/ehdoE.png
在函数package.json
中,按如下方式编辑lint
脚本:
eslint --ext .ts src
这个问题在这次提交中得到了解决。
在functions
文件夹中,打开package.json
并编辑以lint
开头的行,如下所示:
"lint": "eslint "src/**/*""
此问题已通过Firebase CLI 8.12.0版本解决。更新是将参数周围的引号转义为esint,如本次提交所示。