1

我在尝试部署 firebase 功能时遇到问题。如果我尝试做 firebase -deploy 我最终会出现以下错误。我正在使用 Windows 10 和 git bash 来运行它。我的 Firebase 版本:3.19.3 npm -v:6.2.0

gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\14.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Users\vikce\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\build.js:262:23)
gyp ERR! stack     at emitTwo (events.js:126:13)
gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
gyp ERR! System Windows_NT 10.0.17134
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vikce\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "build" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\vikce\\OneDrive\\Documents\\moblizeIt\\moblizeit-bots-offering\\mit-bots\\functions\\node_modules\\firebase-admin\\node_modules\\grpc\\src\\node\\extension_binary\\node-v57-win32-x64\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\vikce\\OneDrive\\Documents\\moblizeIt\\moblizeit-bots-offering\\mit-bots\\functions\\node_modules\\firebase-admin\\node_modules\\grpc\\src\\node\\extension_binary\\node-v57-win32-x64"
gyp ERR! cwd C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc
gyp ERR! node -v v8.10.0
gyp ERR! node-gyp -v v3.7.0
gyp ERR! not ok
node-pre-gyp ERR! build error
node-pre-gyp ERR! stack Error: Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\vikce\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64\grpc_node.node --module_name=grpc_node --module_path=C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:126:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:214:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:925:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:209:5)
node-pre-gyp ERR! System Windows_NT 10.0.17134
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\vikce\\OneDrive\\Documents\\moblizeIt\\moblizeit-bots-offering\\mit-bots\\functions\\node_modules\\firebase-admin\\node_modules\\grpc\\node_modules\\node-pre-gyp\\bin\\node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc
node-pre-gyp ERR! node -v v8.10.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\vikce\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js build --fallback-to-build --library=static_library --module=C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64\grpc_node.node --module_name=grpc_node --module_path=C:\Users\vikce\OneDrive\Documents\moblizeIt\moblizeit-bots-offering\mit-bots\functions\node_modules\firebase-admin\node_modules\grpc\src\node\extension_binary\node-v57-win32-x64' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.6.0 install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the grpc@1.6.0 install 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:\Users\vikce\AppData\Roaming\npm-cache\_logs\2018-07-23T15_07_00_437Z-debug.log
4

1 回答 1

1

确保您已登录到 Firebase

firebase login

然后做

firebase use --add

在文件夹内尝试

firebase deploy --only functions

这不是尝试部署可以针对功能的整个文件。

于 2018-08-17T19:36:38.913 回答