How to solve EACCES permissions errors while installing Appium on Mac?

Deniz Sivas
2 min readMar 3, 2023

--

Probably you have faced this so called permission issue while trying to set your testing environment up. There are some solutions available on the net but seems like they are outdated. The solution that I will mention below was tried on macOS Monterey 12.6.3 with M1 Apple Silicon processor and worked like a charm.

In order to get rid of the residual files go to your home directory by following Finder > Go > Home.

Use the combination of < Cmd + Shift + . > to make the hidden files visible and check .profile file. If it is empty, delete the .profile file. If not, copy the content of it to a temporary text file and delete the .profile file.

Ensure that you are able to see the path bar in Finder, if not follow View > Show Path Bar.

Click the home directory at the end of the path bar while holding control and select New Terminal at Folder option.

On terminal, call the below commands.

mkdir ~/.npm-global
npm config set prefix '~/.npm-global'
touch .profile

Open up the .profile file by double clicking it. By default, it will be opened up with a text editor. When it is opened, add the below lines to your profile file.

export PATH=~/.npm-global/bin:$PATH

After adding this line, go back to terminal and call the below command.

source ~/.profile

Now we can give it a try to install Appium by calling,

npm install -g appium
npm install wd

If you had some other configs defined previously to your .profile file, now it is time to add them to your .profile file again by using a text editor or vim/nano.

Congrats, we have installed Appium via terminal!

--

--

Deniz Sivas
Deniz Sivas

Written by Deniz Sivas

Tester by profession, developer by passion

No responses yet