When I run any SFDX command I get the following error. I looked everywhere but I'm not sure which solution is applicable in this case.

(node:3778) [EACCES] Error Plugin: sfdx-cli: EACCES: permission denied, open '/Users/dk/.sf/sf.log'
module: @oclif/[email protected]
task: runHook init
plugin: sfdx-cli
root: /Users/dk/.local/share/sfdx/client/7.157.0-adf40ea
See more details with DEBUG=*
(Use `node --trace-warnings ...` to show where the warning was created)
sfdx-cli/7.157.0 darwin-x64 node-v16.15.1

sudo seems to be working but I'm not sure what changed, this was working fine. Any suggestions?

  • Have you seen this? (Apologies for citing myself...) The only difference here is the directory .sf , possibly. Jul 7, 2022 at 12:13

2 Answers 2


Faced as well with the error message "EACCES: permission denied, open '/Users/user/.sf/sf.log'". I assume something changed with default permissions when Apple releases security updates.

So you don't have sufficient permissions to write to the specified file. To fix this issue on macOS, you can try the following steps:

Open Terminal and navigate to the directory where the file is located .

Run the following bash command to change the ownership of the file to your user account:

sudo chown $(whoami) /Users/{your_user}/.sf/sf.log

Run the following command to change the permissions on the file so that your user account has write access: bash

chmod u+w /Users/{your_user}/.sf/sf.log

Try running the sfdx deploy command again in Visual Studio Code.


(installed Intel version on mac)

Manually deleting the log files, directories, and the cache in Library* fixed this specific error for me. I also went with NVM to install node and latest npm (which was not too obviously recommended in the docs and release notes)

Basically it was trying to write to the log file but had some permission issues.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .