Error while installing appium uiautomator2 driver

Hi folks!
I have tried installing the uiautomator2 using the command : appium driver install uiautomator2, but I was facing the below error

The versions are :-
node : v14.21.0
npm : 6.14.17
appium : 2.0.0-beta.62

It would be good if anyone assist me in resolving this issue.
Thank you !

try updating npm version and reinstall. I think I had a similar issue and this is how I solved it.

Updated the npm version to 9.6.4, and now getting this issue

try sudo appium driver install uiautomator2

Thanks a lot.
The below command have resolved the issue.
sudo chown -R 503:20 "/Users/dakshana.j/package.json"

Hi Sir
I tried this command but it is not working , I am alos facing issue on uiautomator2 installer

image image