本文介绍了firebase-tools无法安装,为什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我无法在Mac机器上安装firebase-tools.firebase-tools错误,以及安​​装后,firebase init错误我搜索了此问题,但找不到解决方法

I cannot install firebase-tools on my mac machine.firebase-tools error, and after install , firebase init errorI searched this problem, but I can't find solution

我重新安装了node,firebase,node-gyp ...等.

i reinstalled node, firebase, node-pre-gyp....etc.

> sudo npm install -g firebase-tools

npm WARN deprecated [email protected]: Use uuid module instead
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase-tools/bin/firebase

> [email protected] install /usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli
> node-pre-gyp install --fallback-to-build

node-pre-gyp ERR! Tried to download(undefined): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
node-pre-gyp ERR! Tried to download(403): https://node-zopfli.s3.amazonaws.com/Release/zopfli-v1.4.0-node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/Huks/.pyenv/shims/python2 -c import platform; print(platform.python_version());
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.13
gyp ERR! stack   2.7.9
gyp ERR! stack
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:270:12)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:545:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64/zopfli.node" "--module_name=zopfli" "--module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli
gyp ERR! node -v v8.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 '/usr/local/Cellar/node/8.4.0/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64/zopfli.node --module_name=zopfli --module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/firebase-tools/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli
node-pre-gyp ERR! node -v v8.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/8.4.0/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --module=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64/zopfli.node --module_name=zopfli --module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64' (1)

> [email protected] install /usr/local/lib/node_modules/firebase-tools/node_modules/grpc
> node-pre-gyp install --fallback-to-build --library=static_library

gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/Huks/.pyenv/shims/python2 -c import platform; print(platform.python_version());
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.13
gyp ERR! stack   2.7.9
gyp ERR! stack
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:270:12)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:545:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--module=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64/zopfli.node" "--module_name=zopfli" "--module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli/lib/binding/node-v57-darwin-x64"
gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/node-zopfli
gyp ERR! node -v v8.4.0
gyp ERR! node-gyp -v v3.6.2
gyp ERR! not ok
node-pre-gyp ERR! Tried to download(undefined): https://storage.googleapis.com/grpc-precompiled-binaries/node/grpc/v1.4.1/node-v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for [email protected] and [email protected] (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: Command failed: /Users/Huks/.pyenv/shims/python2 -c import platform; print(platform.python_version());
gyp ERR! stack pyenv: python2: command not found
gyp ERR! stack
gyp ERR! stack The `python2' command exists in these Python versions:
gyp ERR! stack   2.7.13
gyp ERR! stack   2.7.9
gyp ERR! stack
gyp ERR! stack
gyp ERR! stack     at ChildProcess.exithandler (child_process.js:270:12)
gyp ERR! stack     at emitTwo (events.js:125:13)
gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
gyp ERR! stack     at Socket.stream.socket.on (internal/child_process.js:348:11)
gyp ERR! stack     at emitOne (events.js:115:13)
gyp ERR! stack     at Socket.emit (events.js:210:7)
gyp ERR! stack     at Pipe._handle.close [as _onclose] (net.js:545:12)
gyp ERR! System Darwin 16.7.0
gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/node-gyp/bin/node-gyp.js" "configure" "--fallback-to-build" "--library=static_library" "--module=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node" "--module_name=grpc_node" "--module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary"
gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/grpc
gyp ERR! node -v v8.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 '/usr/local/Cellar/node/8.4.0/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary' (1)
node-pre-gyp ERR! stack     at ChildProcess.<anonymous> (/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/node-pre-gyp/lib/util/compile.js:83:29)
node-pre-gyp ERR! stack     at emitTwo (events.js:125:13)
node-pre-gyp ERR! stack     at ChildProcess.emit (events.js:213:7)
node-pre-gyp ERR! stack     at maybeClose (internal/child_process.js:927:16)
node-pre-gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:211:5)
node-pre-gyp ERR! System Darwin 16.7.0
node-pre-gyp ERR! command "/usr/local/Cellar/node/8.4.0/bin/node" "/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/node_modules/.bin/node-pre-gyp" "install" "--fallback-to-build" "--library=static_library"
node-pre-gyp ERR! cwd /usr/local/lib/node_modules/firebase-tools/node_modules/grpc
node-pre-gyp ERR! node -v v8.4.0
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/Cellar/node/8.4.0/bin/node /usr/local/lib/node_modules/node-gyp/bin/node-gyp.js configure --fallback-to-build --library=static_library --module=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary/grpc_node.node --module_name=grpc_node --module_path=/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/src/node/extension_binary' (1)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/firebase-tools/node_modules/node-zopfli):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-pre-gyp install --fallback-to-build`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/firebase-tools/node_modules/grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] install: `node-pre-gyp install --fallback-to-build --library=static_library`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1

  • [email protected]添加了154个程序包,并在76.424s中更新了1个程序包

    • [email protected] 154 packages and updated 1 package in 76.424s

    • 推荐答案

      我在安装Firebase工具时也遇到了类似的错误,然后我尝试安装对我有用的更改项目目录.我以这种方式解决了这个错误,有时会对您有所帮助.我更改了目录cd C:\Users\yourusername\AppData\Roaming\npm\node_modulesC:\ Users \您的用户名\ AppData \ Roaming \ npm \ node_modules> npm install -g firebase-tools

      i too got same like errors in installing firebase tools then i tried to install changing project directory worked for me .I fixed the error this way,sometime it will help you. i changed the directory cd C:\Users\yourusername\AppData\Roaming\npm\node_modulesC:\Users\yourusername\AppData\Roaming\npm\node_modules>npm install -g firebase-tools

      这篇关于firebase-tools无法安装,为什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-22 22:10