我最近遇到了 firebase deploy 命令的问题。在 firebase deploy 命令之后,除了 firebase(存储、数据库等)之外,所有其他的都被部署了所以我决定重新安装 firebase 来解决这个问题,但是重新安装后我的问题变得更大了。现在它们都没有部署并出现以下错误:
i deploying database, functions
Running command: npm --prefix $RESOURCE_DIR run lint
npm ERR! path C:\Users\faruk\Google Drive\Android\firebase\1\$RESOURCE_DIR\package.json
npm ERR! code ENOENT
npm ERR! errno -4058
npm ERR! syscall open
npm ERR! enoent ENOENT: no such file or directory, open 'C:\Users\faruk\Google Drive\Android\firebase\1\$RESOURCE_DIR\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! C:\Users\faruk\AppData\Roaming\npm-cache\_logs\2018-01-24T18_21_34_878Z-debug.log
Error: functions predeploy error: Command terminated with non-zero exit code4294963238
经过一番研究,我看到了一些关于这个的话题,建议改变
$RESOURCE_DIR to %RESOURCE_DIR%
在 Windows 系统中(我正在使用 Windows 10 顺便说一句)。因此,我编辑了 位于函数文件夹上一层的firebase.json文件。像这样。(我不知道这是否是我应该编辑的正确文件)
"database": {
"rules": "database.rules.json"
},
"functions": {
"predeploy": [
"npm --prefix %RESOURCE_DIR% run lint"
]
}
}
但在此编辑之后,我开始收到另一条这样的错误消息。
i deploying database, functions
Running command: npm --prefix %RESOURCE_DIR% run lint
Usage: npm <command>
where <command> is one of:
access, adduser, bin, bugs, c, cache, completion, config,
ddp, dedupe, deprecate, dist-tag, docs, doctor, edit,
explore, get, help, help-search, i, init, install,
install-test, it, link, list, ln, login, logout, ls,
outdated, owner, pack, ping, prefix, profile, prune,
publish, rb, rebuild, repo, restart, root, run, run-script,
s, se, search, set, shrinkwrap, star, stars, start, stop, t,
team, test, token, tst, un, uninstall, unpublish, unstar,
up, update, v, version, view, whoami
npm <command> -h quick help on <command>
npm -l display full usage info
npm help <term> search for help on <term>
npm help npm involved overview
Specify configs in the ini-formatted file:
C:\Users\faruk\.npmrc
or on the command line via: npm <command> --key value
Config info can be viewed via: npm help config
npm@5.6.0 C:\Program Files\nodejs\node_modules\npm
Error: functions predeploy error: Command terminated with non-zero exit code1
任何建议表示赞赏。提前致谢。