Failed to Install ArkTS on Mac#
Error message:
Installing ArkTS dependencies...
Running 'npm install'...
npm ERR! code ETARGET
Reference: Failed to Install ArkTS, Need Help. The reason is that the node version is too high, and it needs to be downgraded.
Check the node version:
node -v
To downgrade node, first install nvm
using brew
:
brew install nvm
Then install a lower version of node using nvm
:
nvm install v14.21.3
After the installation is complete, check the node version again. If the node version is still incorrect, run the following command:
nvm use v14.21.3
After downgrading node, clean the npm cache:
npm cache clean -f
Then restart DevEco-Studio
and try installing again. This should successfully install ArkTS.