1

安装 node 和 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

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

4

1 回答 1

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
于 2018-02-08T13:47:50.877 回答