2017-08-27 259 views
1

我無法在我的Mac機上安裝firebase-tools。 火力工具的錯誤,並安裝後,火力初始化錯誤 我搜索了這個問題,但我不能找到解決firebase-tools無法安裝,爲什麼?

我重新安裝節點,火力點,節點前GYP ....等。

> 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包

+0

firebase登錄完成。但是,firebase init是錯誤的。 :( –

+0

gyp ERR仍然是,但現在它工作。我不知道爲什麼。 –

回答

0

我也得到了相同的錯誤安裝Firebase工具,然後我試圖安裝改變項目目錄爲我工作。 我以這種方式解決了錯誤,有時它會幫助你。我更改了目錄cd C:\Users\yourusername\AppData\Roaming\npm\node_modules C:\ Users \ yourusername \ AppData \ Roaming \ npm \ node_modules>npm install -g firebase-tools

+0

謝謝。它的工作原理:)我沒有重新安裝我的Mac電腦上的所有庫。 –

相關問題