1

i'm trying to install firebase-tools in ubuntu (16.04) but i get an error

after i execute the command line:

npm install -g firebase-tools

The error:

npm ERR! tar.unpack untar error /home/rezk/.npm/firebase-tools/3.2.1/package.tgz

npm ERR! Linux 4.4.0-59-generic npm ERR! argv "/usr/bin/nodejs" "/usr/bin/npm" "install" "-g" "firebase-tools" npm ERR! node v4.4.7 npm ERR! npm v2.15.8 npm ERR! path /usr/lib/node_modules/firebase-tools npm ERR! code EACCES npm ERR! errno -13 npm ERR! syscall mkdir

npm ERR! Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/firebase-tools' npm ERR! at Error (native) npm ERR! { [Error: EACCES: permission denied, mkdir '/usr/lib/node_modules/firebase-tools'] npm ERR! errno: -13, npm ERR! code: 'EACCES', npm ERR! syscall: 'mkdir', npm ERR! path: '/usr/lib/node_modules/firebase-tools', npm ERR! fstream_type: 'Directory', npm ERR! fstream_path: '/usr/lib/node_modules/firebase-tools', npm ERR! fstream_class: 'DirWriter', npm ERR! fstream_stack: npm ERR! [ '/usr/lib/node_modules/npm/node_modules/fstream/lib/dir-writer.js:35:25', npm ERR! '/usr/lib/node_modules/npm/node_modules/mkdirp/index.js:47:53', npm ERR! 'FSReqWrap.oncomplete (fs.js:82:15)' ] } npm ERR! npm ERR! Please try running this command again as root/Administrator.

npm ERR! Please include the following file with any support request: npm ERR! /home/rezk/npm-debug.log

how could i solve that? Note: i have installed Node.js

Dz_Hero
  • 41
  • 1
  • 4

1 Answers1

2

i think it just about using sudo before the command line:

sudo npm install -g firebase-tools

thank you!

Dz_Hero
  • 41
  • 1
  • 4
  • 1
    FYI, installing npm packages with sudo can sometimes lead to pain. There are alternatives: https://github.com/sindresorhus/guides/blob/master/npm-global-without-sudo.md – cartant Jan 26 '17 at 06:57
  • @cartant could you explain why? I just install the new version of firebase-tools with sudo on my ubuntu 14.04 and I'm now I can't deploy on local... I don't know If I need to unistall and install it again – Jaco Sep 13 '17 at 07:00
  • 1
    @Jaco Using sudo can effect significant permissions problems. It's a mistake I made once and never again. Read the link which itself has a link to an npm article (at the bottom) that might help explain the problem. – cartant Sep 13 '17 at 07:13