解决办法: touch ~/.npmrc vim ~/.npmrc
写入如下内容 registry=https://repo.huaweicloud.com/repository/npm/ @ohos:registry=https://repo.harmonyos.com/npm/