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

Hi, I am getting following error while installing UIAutomator 2. Can anyone tell how to resolve this?
:heavy_multiplication_x: Installing ‘uiautomator2’ using NPM install spec ‘appium-uiautomator2-driver’
Error: :heavy_multiplication_x: Encountered an error when installing package: npm command ‘install --save-dev --omit=peer --save-exact --global-style --no-package-lock appium-uiautomator2-driver --json’ failed with code 1.

STDOUT:
{
“error”: {
“code”: “ENOTFOUND”,
“summary”: “request to https://registry.npm.org/appium-uiautomator2-driver failed, reason: getaddrinfo ENOTFOUND registry.npm.org”,
“detail”: “This is a problem related to network connectivity.\nIn most cases you are behind a proxy or have bad network settings.\n\nIf you are behind a proxy, please make sure that the\n’proxy’ config is set properly. See: ‘npm help config’”
}

Npm can’t find the repository due to a lack of network connectivity. Do you have a working internet connection? If so, are you behind a proxy?

You can set npm proxy settings using

npm config set proxy

OR

npm config set https-proxy

You’ll need to find out your proxy settings