尝试在firebase上部署项目会给我以下错误 任何想法,谢谢你的帮助
sherif Folio $ firebase deploy
=== Deploying to 'plan2-plan2'...
i deploying functions, hosting
Running command: npm --prefix "$RESOURCE_DIR" run lint
npm ERR! path /home/sherif/functions/package.json
npm ERR! code ENOENT
npm ERR! errno -2
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open
'/home/sherif/functions/package.json'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent
npm ERR! A complete log of this run can be found in:
npm ERR! /home/sherif/.npm/_logs/2018-04-28T22_14_49_737Z-
debug.log
Error: functions predeploy error: Command terminated with non-zero
exit code254
答案 0 :(得分:2)
我也遇到了这样的问题,最终我要做的是编辑firebase.json文件并将preflight命令更改为npm --prefix ./functions run lint
。这似乎在Linux和Windows上都可以。
文件中的初始代码:
{
"functions": {
"predeploy": [
"npm --prefix \"$RESOURCE_DIR\" run lint"
]
}
}