Issue in doing installation for [email protected]

Command used-
‘npm install --global --verbose --no-audit --unsafe-perm=true --allow-root [email protected]

[email protected] installation works fine when running directly on server via terminal but when we run it via code using py subprocess it eventually fails and exits with code 1 and gives error while running post install script in npm installation process itself.

Error I am getting- module not found /root/.atf2/.nvm/versions/node/v20.11.1/lib/node_modules/appium/scripts/autoinstall-extensions.js

Try with --force tag once

We tried force also, but did not work. While when we upgrade npm version 8.0.0 to 9+ error gets resolved. So we should use npm 9 and above for [email protected]?