尝试为CLI安装firebase-tool。失败。
在macOS上运行
我看到了如下建议...
Troubling with installing firebase-tools
我尝试了$ sudo npm安装-g firebase工具
使用“sudo”可以克服尝试访问目录时的错误问题。但仍然崩溃
麻烦的是
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
我可以把上面的网址在浏览器中,它会下载的tar。
即使使用“sudo”,我也有访问问题
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'
试图了解如何通过错误安装firebase工具,也有一些建议说,通过nvm安装节点。发现tutorial on nvm,任何人都知道这样做安装会到我已经在我的机器上的项目。例如,困惑找到正确的node.js,或需要重新安装一切,我已经安装使用我当前的节点安装?
完整的错误消息如下...
sudo npm install -g firebase-tools
Password:
npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
/usr/local/bin/firebase -> /usr/local/lib/node_modules/firebase- tools/bin/firebase
> grpc@1.4.1 install /usr/local/lib/node_modules/firebase- tools/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.4.1/node- v57-darwin-x64.tar.gz
node-pre-gyp ERR! Pre-built binaries not found for grpc@1.4.1 and node@8.9.4 (node-v57 ABI) (falling back to source compile with node-gyp)
gyp ERR! configure error
gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'
gyp ERR! System Darwin 17.3.0
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/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.9.4
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/bin/node /usr/local/lib/node_modules/npm/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: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 Darwin 17.3.0
node-pre-gyp ERR! command "/usr/local/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.9.4
node-pre-gyp ERR! node-pre-gyp -v v0.6.36
node-pre-gyp ERR! not ok
Failed to execute '/usr/local/bin/node /usr/local/lib/node_modules/npm/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: grpc@1.4.1 (node_modules/firebase-tools/node_modules/grpc):
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: grpc@1.4.1 install: `node- pre-gyp install --fallback-to-build --library=static_library`
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: Exit status 1
+ firebase-tools@3.17.4
added 8 packages and updated 1 package in 37.194s
我还尝试cd到node_modules目录,并按照本文的建议从那里运行安装
firebase-tools cannot install, why?
结果是一页又一页的警告消息,最后是错误
npm ERR! path /usr/local/lib/node_modules/firebase-tools/bin/firebase
npm ERR! code ELOOP
npm ERR! errno -62
npm ERR! syscall chmod
npm ERR! ELOOP: too many symbolic links encountered, chmod '/usr/local/lib/node_modules/firebase-tools/bin/firebase'
6条答案
按热度按时间axzmvihb1#
在Windows上工作,不会导致任何错误。但当它涉及到Mac,你需要启动它与sudo。所以命令将是:
然后在终端上使用
firebase -V
检查版本,以确保您的操作正确。cx6n0qe32#
我遇到了同样的问题,我所做的是确保我在根目录和运行:
或在Windows中
我不断地在我的项目文件夹中做这件事,不断地得到同样的错误。
n8ghc7c13#
我在macOS High Sierra上也遇到了同样的问题,最后唯一对我有效的是从Homebrew卸载node.js(brew卸载节点),然后使用可下载的安装程序(https://nodejs.org/en/download/)安装node.js,然后使用sudo安装Firebase CLI:sudo npm安装-g firebase工具
在那之后,我仍然收到了警告,但可以启动和配置Firebase。不是一个理想的解决方案,但它目前正在为我提供修复。
atmip9wb4#
sudo npm安装-g firebase工具
须藤为我工作!
如果没有sudo,我会得到以下错误:
l3zydbqr5#
从其网站上的软件包安装Node,而不是通过Brew,为我解决了这个问题。
vi4fp9gy6#
在我的案例中,我安装了一个损坏的Firebase,通过运行以下命令解决:
如果你还没有Firebase,你可以运行:
参考:https://firebase.google.com/docs/cli#mac-linux-auto-script