Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"EACCES: permission denied" when using "firebase serve"

I am using "firebase serve" to test my Firebase web app locally. I ran into this error every time:

Error: EACCES: permission denied, open '/Users/[my_user_name]/.config/configstore/@google-cloud/functions-emulator/.functions.json' You don't have access to this file.

Error: EACCES: permission denied, open '/usr/local/lib/node_modules/firebase-tools/node_modules/@google-cloud/functions-emulator/logs/cloud-functions-emulator.log'

It does work with a sudo. But I don't want to type in my sudo password every time. Every other command works fine without sudo except for this one.

like image 889
Xi 张熹 Avatar asked Oct 21 '25 16:10

Xi 张熹


1 Answers

If you don't want to run sudo every time, you need to install node in your home directory where you have full control. Don't use the node that you may have installed with a package manager using the system's default settings. The typical tool to help you with a home directory installation is Node Version Manager (nvm).

like image 73
Doug Stevenson Avatar answered Oct 23 '25 08:10

Doug Stevenson