firebase-tools install throws 'root does not have permission' error repeatedly

firebase-tools install throws 'root does not have permission' error repeatedly

During installtion of firebase-tools, you see a repeated output about ‘root does not have permission’ error. This is one way to fix that issue. 1 sudo npm install -g firebase-tools Error/Warning 12 gyp WARN EACCES user "root" does not have permission to access the dev dir "/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/.node-gyp/8.9.1" gyp WARN EACCES attempting to reinstall using temporary dev dir "/usr/local/lib/node_modules/firebase-tools/node_modules/grpc/.node-gyp" Here is what I did to avoid this: