求助~鸿蒙系统windows环境搭建(hpm-cli安装失败)!

系统win10,执行命令“npm install -g @ohos/hpm-cli”,报错如下:

npm ERR! code EEXIST
npm ERR! path C:\Users\jay\AppData\Roaming\npm\node_modules\@ohos\hpm-cli\bin\hpm
npm ERR! dest C:\Users\jay\AppData\Roaming\npm\hpm
npm ERR! EEXIST: file already exists, cmd shim 'C:\Users\jay\AppData\Roaming\npm\node_modules\@ohos\hpm-cli\bin\hpm' -> 'C:\Users\jay\AppData\Roaming\npm\hpm'
npm ERR! File exists: C:\Users\jay\AppData\Roaming\npm\hpm
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR!     C:\Users\jay\AppData\Roaming\npm-cache\_logs\2020-10-21T13_50_56_526Z-debug.log     
The terminal process "C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe -Command npm install -g @ohos/hpm-cli" terminated with exit code: 1.

鸿蒙
windows环境
hpm-cli
2020-10-21 21:54:49
浏览
2
收藏 1
回答 1
已解决
回答 1
按赞同
/
按时间
HarryP0tter
1

太困难了,终于安装成功了。

原因:

1.官方提供的网址连接超时,更换为阿里源npm config set registry https://registry.npm.taobao.org;

2.本地可能存在旧版本hpm,按提示删除已存在的hpm,再执行npm install -g @ohos/hpm-cli;

3.安装成功,hpm -V会显示版本号;

分享
微博
QQ
微信
回复2
2020-10-21 22:46:16
相关问题
windows安装hpm出错
5374浏览 • 1回复 待解决
搭建鸿蒙环境时,编译报错
9892浏览 • 3回复 待解决
无法检测到hpm求助各位大佬
5571浏览 • 2回复 已解决
求助镜像语言环境判断方法?
3680浏览 • 1回复 待解决
针对Windows system32 无法正常安装
4822浏览 • 1回复 待解决
OpenHarmony-2.2-Beta2 编译失败求助
6808浏览 • 1回复 已解决
win11下安装hpm报错如何解决?
4225浏览 • 2回复 待解决
安装开发者工具安装js依赖失败
8466浏览 • 1回复 待解决
什么时候可以安装鸿蒙系统
7281浏览 • 1回复 待解决
ohpm安装失败怎么回事?
434浏览 • 1回复 待解决