报错:No port is available from the preconfigured port range. Close all other apps and restart the Previewer.

找到对应的日志 看下端口号是哪个有问题 然后查看系统 
测试下来 大概率是系统不兼容引起的 同时看下自身有没有开启代理软件 占用端口号 最终大法是重启电脑 就可以正常使用了
/Users/mrxiao/.hvigor/daemon/log

报错 Error: The hvigor depends on the npmrc file. Configure the npmrc file first.

解决办法:
touch ~/.npmrc
vim ~/.npmrc

registry=https://repo.huaweicloud.com/repository/npm/
@ohos:registry=https://repo.harmonyos.com/npm/