【发布时间】:2022-01-09 02:33:58
【问题描述】:
我已经安装了:
npm 8.1.4
节点 16.13.0
我正在尝试将一些功能部署到 Unity 项目的 Firebase 数据库,但执行 firebase deploy 命令时返回错误:
C:\Users\xxx\OneDrive\CloudFunction\FirebaseFunctions\functions>firebase deploy
=== Deploying to 'xxx'...
i deploying functions
Running command: npm --prefix "$RESOURCE_DIR" run lint
> lint
> eslint .
C:\Users\xxx\OneDrive\CloudFunction\FirebaseFunctions\functions\index.js
47:95 error Parsing error: Unexpected token =>
✖ 1 problem (1 error, 0 warnings)
node:events:368
throw er; // Unhandled 'error' event
^
Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
at notFoundError (C:\Users\xxx\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:6:26)
at verifyENOENT (C:\Users\xxx\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:40:16)
at ChildProcess.cp.emit (C:\Users\xxx\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:27:25)
at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12)
Emitted 'error' event on ChildProcess instance at:
at ChildProcess.cp.emit (C:\Users\xxx\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\cross-env\node_modules\cross-spawn\lib\enoent.js:30:37)
at Process.ChildProcess._handle.onexit (node:internal/child_process:290:12) {
code: 'ENOENT',
errno: 'ENOENT',
syscall: 'spawn npm --prefix "%RESOURCE_DIR%" run lint',
path: 'npm --prefix "%RESOURCE_DIR%" run lint',
spawnargs: []
}
Error: functions predeploy error: Command terminated with non-zero exit code1
由于 lint 对我来说是新的,以下错误是什么意思以及如何解决:
Error: spawn npm --prefix "%RESOURCE_DIR%" run lint ENOENT
错误也指向index.js中的这个UploadAndCompressVideo函数:
exports.UploadAndCompressVideo = functions.runWith(vdeioUploadOpts).https.onCall(async (data) => {
...
});
【问题讨论】:
标签: node.js npm firebase-realtime-database lint