Firebase-Tools无法通过MacOS上的终端安装加载



尝试安装CLI的Firebase-Tool。获得失败。

在MacOS上运行

我看到了以下建议...

安装firebase-tools

感到不安

我尝试了$ sudo npm install -g firebase -tools

使用" 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 

我可以将上述URL放入浏览器中,它将下载焦油。

我也有访问问题,即使我使用'sudo'

 gyp ERR! stack Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/build'

试图了解如何克服错误以安装firebase-tools的错误,也说一些建议是通过NVM安装节点。在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无法安装,为什么?

结果是警告消息的页面和页面,最后是错误

 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'
npm install -g firebase-tools

在Windows上工作而不会引起任何错误。但是,当涉及到Mac时,您需要从Sudo开始。因此,命令将是:

sudo npm install -g firebase-tools

然后在终端上使用firebase -V检查版本以确保您已经正确完成了。

我遇到了同样的问题,确保我在根目录中并运行:

sudo npm i g firebase-tools

或Windows

npm i g firebase-tools

我一直在我的项目文件夹中执行此操作,并继续遇到相同的错误。

我在MacOS High Sierra上也有同样的问题。最终对我有用的唯一一件事是从Homebrew(Brew卸载节点(卸载Node.js,然后使用可下载的安装程序(https://nodejs.org/en/download/(安装node.js,然后安装使用Sudo的Firebase CLI:sudo npm install -g firebase -tools

之后,我仍然收到警告,但可以启动和配置Firebase。不是理想的解决方案,但目前正在为我解决。

在我的情况下,我有一个损坏的火箱安装,可以通过运行:

来解决:
curl -sL firebase.tools | upgrade=true bash

如果您已经没有壁炉,则可以运行:

curl -sL firebase.tools

参考:https://firebase.google.com/docs/cli#mac-linux-auto-script

sudo npm install -g firebase -tools

sudo为我工作!

没有sudo,我会收到以下错误:

Lewis-MacBook-Pro:demo-firebase-func leg$ npm install -g firebase-tools
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules'
npm ERR!   stack: 'Error: EACCES: permission denied, access '/usr/local/lib/node_modules'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules' }
npm ERR! 
npm ERR! The operation was rejected by your operating system.
npm ERR! It is likely you do not have the permissions to access this file as the current user
npm ERR! 
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator (though this is not recommended).
npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/leg/.npm/_logs/2018-10-03T20_35_51_209Z-debug.log

从其网站上安装节点,而不是通过啤酒为我解决此问题。

最新更新