无法在Windows上安装Firebase工具

3

你好,我无法通过管理员模式使用命令提示符安装Firebase工具,并且我收到以下错误:

F:\rnd\MyChat>npm install  firebase

> grpc@1.8.4 install F:\rnd\MyChat\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-v57-win32-x64-unknown.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.8.4 and node@8.9.3 (node-v57 ABI, unknown) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.
gyp ERR! stack     at PythonFinder.failNoPython (C:\Users\ani\AppData\Roaming\npm\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)
gyp ERR! stack     at PythonFinder.<anonymous> 
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.

@SurajRao 已经尝试过了,但是不起作用。 - Madpop
你安装了Python吗? - Suraj Rao
2.7版本。 - Madpop
尝试运行 npm config set python "<path_to_python_exe>",然后再次运行 npm install。 - jester
@jester 已经做了,但问题仍然存在。 - Madpop
显示剩余8条评论
4个回答

3

您正在尝试安装firebase JavaScript库,而不是firebase-tools。Firebase工具的Node模块是firebase-tools,同时需要安装Firebase 3.16版本和本地文件夹中的npm install node-gyp

您应该运行:

npm install -g firebase-tools

我尝试安装Firebase工具和Firebase,但在输入您的命令后,出现以下错误: npm WARN deprecated node-uuid@1.4.8: Use uuid module instead & > grpc@1.8.4 install F:\rnd\MyChat\node_modules\grpc
node-pre-gyp install --fallback-to-build --library=static_library
- Madpop
尝试运行此命令 npm install -g node-pre-gyp,你得到了什么? - Ali Faris
安装您的命令,以下是我收到的响应 + node-pre-gyp@0.6.39 在 66.884 秒内添加了 113 个软件包。 - Madpop
npm警告:node-uuid@1.4.8已弃用:请改用uuid模块 C:\Users\ani\AppData\Roaming\npm\firebase -> C:\Users\ani\AppData\Roaming\npm\node_modules\firebase-tools\bin\firebase
grpc@1.4.1 安装于 C:\Users\ani\AppData\Roaming\npm\node_modules\firebase-tools\node_modules\grpc node-pre-gyp install --fallback-to-build --library=static_library
node-pre-gyp ERR!尝试下载(undefined):https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-win32-x64.tar.gz node-pre-gyp ERR!找不到grpc@1.4.1node@8.9.4(node-v57 ABI)的预构建二进制文件
- Madpop

0

0

这是可能有效的东西,请尝试按照以下步骤操作。

npm i -g firebase-tools

0

最终,我通过以下步骤解决了我的问题

首先,在我的本地文件夹中安装了npm install node-gyp,并将firebase-tools版本从3.17降级到3.16。主要是禁用了我的反病毒软件。下面是相关链接的参考:

https://github.com/grpc/grpc-node/issues/121


网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接