安装firebase工具令人烦恼

时间:2018-01-26 16:59:07

标签: firebase google-cloud-functions firebase-cli

安装节点和npm后,我尝试在我的计算机上安装firebase-tools(因为云功能)。这就是我所看到的:

npm WARN deprecated node-uuid@1.4.8: Use uuid module instead
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/firebase-tools
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/firebase-tools/node_modules
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules/firebase-tools/node_modules/@google-cloud
npm WARN checkPermissions Missing write access to /usr/local/lib/node_modules
npm ERR! path /usr/local/lib/node_modules/firebase-tools
npm ERR! code EACCES
npm ERR! errno -13
npm ERR! syscall access
npm ERR! Error: EACCES: permission denied, access '/usr/local/lib/node_modules/firebase-tools'
npm ERR!  { Error: EACCES: permission denied, access '/usr/local/lib/node_modules/firebase-tools'
npm ERR!   stack: 'Error: EACCES: permission denied, access \'/usr/local/lib/node_modules/firebase-tools\'',
npm ERR!   errno: -13,
npm ERR!   code: 'EACCES',
npm ERR!   syscall: 'access',
npm ERR!   path: '/usr/local/lib/node_modules/firebase-tools' }
npm ERR! 
npm ERR! Please try running this command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR!     /Users/joeljohnson/.npm/_logs/2018-01-26T16_56_29_829Z-debug.log

我还没有找到问题的解决方案,我该如何解决?

1 个答案:

答案 0 :(得分:4)

我能解决这个问题。问题是包'grpc'。我不知道错误的确切性质但是通过反复试验我移动到安装了firebase的目录并手动安装了grpc。 对此的命令是。

sudo npm install -g firebase-tools #This will give errors but let it be
cd /usr/lib/node_modules/firebase-tools/
sudo npm install grpc@1.4.1
sudo npm install -g firebase-tools