Can't Install Appium using npm

I’m trying to install appium version 1.7.1 using npm. But i got some errors. Can anyone help me to solve this error ??

npm ERR! code 1
npm ERR! path C:\Users\SGO\AppData\Roaming\npm\node_modules\appium\node_modules\appium-selendroid-driver
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c node ./bin/install.js
npm ERR! C:\Users\SGO\AppData\Roaming\npm\node_modules\appium\node_modules\appium-selendroid-driver\bin\install.js:21
npm ERR! androidHelpers.getJavaVersion(false).then(function tryInstall (version) {
npm ERR! ^
npm ERR! TypeError: androidHelpers.getJavaVersion is not a function
npm ERR! at doInstall (C:\Users\SGO\AppData\Roaming\npm\node_modules\appium\node_modules\appium-selendroid-driver\bin\install.js:21:18)
npm ERR! at Object. (C:\Users\SGO\AppData\Roaming\npm\node_modules\appium\node_modules\appium-selendroid-driver\bin\install.js:63:3)
npm ERR! at Module._compile (internal/modules/cjs/loader.js:1072:14)
npm ERR! at Object.Module._extensions…js (internal/modules/cjs/loader.js:1101:10)
npm ERR! at Module.load (internal/modules/cjs/loader.js:937:32)
npm ERR! at Function.Module._load (internal/modules/cjs/loader.js:778:12)
npm ERR! at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
npm ERR! at internal/main/run_main_module.js:17:47

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\SGO\AppData\Local\npm-cache_logs\2021-09-03T02_16_43_209Z-debug.log

The errors you’ve posted aren’t really helpful. There may be a more obvious issue in the full log.

I accidently posted 2 posts, the relevant post title is ““Can’t install appium via npm command””
I tried to attach the full log, but because I am a new user, I am limited to 4 links per post…
Hopefully it will be enough information appears in log…
Many thanks…