Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/node.js/41.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
为node.js安装firebase admin时发生grpc安装错误_Node.js_Firebase Admin - Fatal编程技术网

为node.js安装firebase admin时发生grpc安装错误

为node.js安装firebase admin时发生grpc安装错误,node.js,firebase-admin,Node.js,Firebase Admin,我最近将我的firebase管理依赖项从5.5.1更新为5.8.2,并尝试安装新的依赖项,但失败了,我无法再部署目录中的云功能 package.json文件是: { "name": "functions", "description": "Cloud Functions for Firebase", "scripts": { "serve": "firebase serve --only functions", "shell": "firebase experimen

我最近将我的firebase管理依赖项从5.5.1更新为5.8.2,并尝试安装新的依赖项,但失败了,我无法再部署目录中的云功能

package.json文件是:

{
  "name": "functions",
  "description": "Cloud Functions for Firebase",
  "scripts": {
    "serve": "firebase serve --only functions",
    "shell": "firebase experimental:functions:shell",
    "start": "npm run shell",
    "deploy": "firebase deploy --only functions",
    "logs": "firebase functions:log"
  },
  "dependencies": {
    "firebase-admin": "~5.8.2",
    "firebase-functions": "^0.8.1"
  },
  "private": true
}
错误日志如下所示:

> grpc@1.8.4 install C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc
> node-pre-gyp install --fallback-to-build --library=static_library

node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.4/node-v59-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.8.4 and node@9.4.0 (node-v59 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Program Files\Python36\", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\kusha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> (C:\Users\kusha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:508:16)
gyp ERR! stack     at C:\Users\kusha\AppData\Roaming\npm\node_modules\npm\node_modules\graceful-fs\polyfills.js:284:29
gyp ERR! stack     at FSReqWrap.oncomplete (fs.js:166:21)
gyp ERR! System Windows_NT 10.0.15063
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kusha\\AppData\\Roaming\\npm\\node_modules\\npm\\node_modules\\node-gyp\\bin\\node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\node_modules\\grpc\\src\\node\\extension_binary\\node-v59-win32-x64-unknown\\grpc_node.node" "--module_name=grpc_node" "--module_path=C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\node_modules\\grpc\\src\\node\\extension_binary\\node-v59-win32-x64-unknown"
gyp ERR! cwd C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc
gyp ERR! node -v v9.4.0
gyp ERR! node-gyp -v v3.6.2
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\kusha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\node_modules\node-pre-gyp\lib\util\compile.js:83:29)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:160:13)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:943:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:220:5)
node-pre-gyp ERR! System Windows_NT 10.0.15063
node-pre-gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\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\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc
node-pre-gyp ERR! node -v v9.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.39
node-pre-gyp ERR! not ok
Failed to execute 'C:\Program Files\nodejs\node.exe C:\Users\kusha\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js configure --fallback-to-build --library=static_library --module=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown\grpc_node.node --module_name=grpc_node --module_path=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\src\node\extension_binary\node-v59-win32-x64-unknown' (1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! grpc@1.8.4 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.8.4 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\kusha\AppData\Roaming\npm-cache\_logs\2018-01-31T18_47_14_943Z-debug.log
>grpc@1.8.4安装C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\U modules\grpc
>节点预gyp安装--回退到构建--库=静态\u库
节点前gyp错误!试图下载(未定义):https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.8.4/node-v59-win32-x64-unknown.tar.gz
节点前gyp错误!找不到的预构建二进制文件grpc@1.8.4及node@9.4.0(node-v59 ABI,未知)(使用node-gyp返回到源代码编译)
哎呀!配置错误
哎呀!堆栈错误:找不到Python可执行文件“C:\Program Files\Python36\”,可以设置Python环境变量。
哎呀!PythonFinder.failNoPython上的堆栈(C:\Users\kusha\AppData\Roaming\npm\node\u modules\npm\node\u modules\node gyp\lib\configure.js:483:19)
哎呀!堆叠在PythonFinder。(C:\Users\kusha\AppData\Roaming\npm\node\u modules\npm\node\u modules\node gyp\lib\configure.js:508:16)
哎呀!堆栈位于C:\Users\kusha\AppData\Roaming\npm\node\u modules\npm\node\u modules\fs\polyfills.js:284:29
哎呀!堆栈在FSReqWrap.oncomplete(fs.js:166:21)
哎呀!系统Windows\u NT 10.0.15063
哎呀!命令“C:\\Program Files\\nodejs\\node.exe”“C:\\Users\\kusha\\AppData\\Roaming\\npm\\node\U modules\\npm\\node\U modules\\node gyp\\bin\\node gyp.js”“配置”“--回退以生成”“--库=静态库”“--module=C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\node\u modules\\grpc\\src\\node\\extension\u binary\\node-v59-win32-x64-unknown\\grpc\u node.node”“--module\u name=grpc\u node”“--module\u path=C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\node\u modules\\grpc\\src\\node\\extension\\extension\u binary\\node\\node\\node\\v59-win32-
gyp ERR!cwd C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\u modules\grpc
GypErr!节点-v9.4.0
gyp ERR!节点gyp-v3.6.2
哎呀!不行
节点预gyp错误!生成错误
节点前gyp错误!堆栈错误:未能执行'C:\Program Files\nodejs\node.exe C:\Users\kusha\AppData\Roaming\npm\node\U modules\npm\node\node\gyp modules\node gyp\bin-gyp.js配置--回退到构建--库=静态库--模块=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\U modules\grpc\src\node\extension\U binary\node-v59-win32-x64-unknown\grpc\U node.node--模块名称=grpc\U节点--模块路径=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\U模块\grpc\src\node\extension\U binary\node-v59-win32-x64-unknown'(1)
ChildProcess上的node pre gyp ERR!堆栈。(C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\node_modules\node pre gyp\lib\util\compile.js:83:29)
ChildProcess.emit(events.js:160:13)处的节点前gyp ERR!堆栈
maybeClose的节点前gyp ERR!堆栈(internal/child_process.js:943:16)
node pre-gyp ERR!在Process.ChildProcess.\u handle.onexit处堆栈(internal/child\u Process.js:220:5)
节点预gyp错误!系统Windows\u NT 10.0.15063
节点前gyp ERR!命令“C:\\Program Files\\nodejs\\node.exe”“C:\\Users\\kusha\\FirebaseWaitlistFunctions\\functions\\node\u modules\\grpc\\node\u modules\\node-pre-gyp\\bin\\node-pre-gyp”“install”“--回退以生成”“--库=静态库”
节点前gyp ERR!cwd C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\u modules\grpc
节点前gyp错误!节点-v9.4.0
节点预gyp错误!节点预gyp-v v0.6.39
节点预gyp错误!不正常
无法执行'C:\Program Files\nodejs\node.exe C:\Users\kusha\AppData\Roaming\npm\node\U modules\npm\node\U modules\node gyp\bin\node-gyp.js configure--fallback to build--library=static\U library--module=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node\grpc\src\node\extension\binary\node\node\node\node-v59-win32-x64-unknown\grpc\node---module_name=grpc_node--module_path=C:\Users\kusha\FirebaseWaitlistFunctions\functions\node_modules\grpc\src\node\extension\u binary\node-v59-win32-x64-unknown'(1)
npm错误!代码错误周期
npm错误!错误1
npm错误!grpc@1.8.4install:`node pre-gyp install--fallback to build--library=static\u library`
npm错误!退出状态1
npm错误!
npm ERR!在以下位置失败:grpc@1.8.4安装脚本。
npm错误!这可能不是npm的问题。上面可能还有其他日志输出。
npm ERR!此运行的完整日志可在以下位置找到:
npm ERR!C:\Users\kusha\AppData\Roaming\npm cache\\ u logs\2018-01-31T18\u 47\u 14\u 943Z-debug.log
我的windows版本是10.0.15063

显示的python错误看起来很愚蠢,因为我安装了python,设置了python变量,并且在path变量中也设置了python变量。从cmd中的任何位置运行python命令都会让我进入python控制台部分

我尝试将firebase工具更新到最新版本3.17.4,但得到了相同的警告,不过它说那里的依赖项是可选的

我将Node.js更新为9.4.0,这是我在官方网站上找到的最新版本。 使用npm安装-g npm将npm更新到5.6.0


不幸的是,我不是Node.js开发人员,这是我第一次尝试使用它,因为我必须使用firebase函数。请给我指出正确的方向,因为我不知道如何解决这个问题。我的函数代码没有问题,因为在我尝试更新依赖项之前,它工作正常。

对于关注此问题的人,请访问在撰写本文时,我找到的唯一解决方案是暂时禁用防病毒服务,以消除此错误

我在运行我的卡巴斯基防病毒软件时看到过这种情况。github库中的多个人已经在多个地方提出了这个问题。 他们中的大多数人发现,禁用防病毒软件可以消除这个问题

解决方案与功能1.0.1配合使用