DevEco Studio安装HarmonyOS JSSDK报错“Run 'npm install' failed”?

huqi
  • 819

该问题是怎么引起的?

各位大佬好,我通过DevEco Studio安装JS SDK时报错。如下图:
输入图片说明

报错信息

日志:

18250 silly saveTree     +-- parse5@2.1.5
18250 silly saveTree     `-- weex-styler@0.1.10
18251 warn ace-loader@1.0.11 No repository field.
18252 warn ace-loader@1.0.11 No license field.
18253 verbose type body-timeout
18254 verbose stack FetchError: Response timeout while trying to fetch https://mirrors.huaweicloud.com/repository/npm/webpack (over 15000ms)
18254 verbose stack     at Timeout._onTimeout (F:\ProgramFile\nodejs\node_modules\node_global\node_modules\npm\node_modules\node-fetch-npm\src\body.js:189:16)
18254 verbose stack     at listOnTimeout (internal/timers.js:549:17)
18254 verbose stack     at processTimers (internal/timers.js:492:7)
18255 verbose cwd C:\Users\huqi\AppData\Local\Huawei\Sdk\.temp\PackageOperation02\unzip\js\build-tools\ace-loader
18256 verbose Windows_NT 10.0.19042
18257 verbose argv "C:\\Program Files\\nodejs\\node.exe" "F:\\ProgramFile\\nodejs\\node_modules\\node_global\\node_modules\\npm\\bin\\npm-cli.js" "install" "--timeout=15000" "--fetch-retry-mintimeout=10000" "--fetch-retry-maxtimeout=15000" "--fetch-retries=1" "-d" "--scripts-prepend-node-path=auto"
18258 verbose node v14.3.0
18259 verbose npm  v6.14.5
18260 error Response timeout while trying to fetch https://mirrors.huaweicloud.com/repository/npm/webpack (over 15000ms)
18261 verbose exit [ 1, true ]

尝试解决

已配置npm镜像:https://mirrors.huaweicloud.c...,但依旧报错
输入图片说明

回复
阅读 6.1k
1 个回答
✓ 已被采纳

已通过设置npm镜像解决:

npm config set registry https://mirrors.huaweicloud.com/repository/npm/
撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏