鸿蒙入门到实战开发 - DevEco Studio 开发工具

762 阅读1分钟

HUAWEI DevEco Studio 基于IntelliJ IDEA Community开源版本定制开发,支持HarmonyOS和OpenHarmony应用及服务开发。

面向全场景多设备,提供一站式的分布式应用开发平台,支持分布式多端开发、分布式多端调测、多端模拟仿真,全方位的质量与安全保障。

DevEco Studio 3.1配套支持HarmonyOS 3.1版本及以上的应用及服务开发,提供了代码智能编辑、低代码开发、双向预览等功能,以及轻量构建工具DevEco Hvigor 、本地模拟器,持续提升应用及服务开发效率。

developer.harmonyos.com/cn/develop/…

下载安装完事遇到这么一个问题

Unable to run 'npm install'.
	 Detail: See https://developer.harmonyos.com/en/docs/documentation/doc-guides/faq-development-environment-0000001168829643#section1311117111474
> hvigor ERROR: Sdk download failed.
> hvigor ERROR: BUILD FAILED in 9 s 401 ms 

刚上来创建一个项目

4061703729898_.pic.jpg 项目结构

4071703729964_.pic.jpg

安装文档执行这一步也失败了。。。

4081703730414_.pic.jpg

Install task failed: JS 3.2.12.5.
Install JS dependencies failed.
Cause: Unable to run npm install.
Solution: See https://developer.harmonyos.com/cn/docs/documentation/doc-guides/faq-development-environment-0000001168829643#section1311117111474

文档说需要来这里清缓存,我打开后发现没有缓存但是也装模作样的清了一下

4091703730734_.pic.jpg

看到这些就是可以了

> hvigor 'npm install' executed
> hvigor Moving the SDK...
> hvigor Install task finished: ArkTS 3.2.12.5
> hvigor Installing Toolchains:3.2.3.6...
> hvigor Install task started: Toolchains 3.2.3.6
> hvigor Downloading https://update.dbankcdn.com/download/data/pub_13/HWHOTA_hota_900_9/cd/v3/6-Eg0KmCSpOpkqSEm-c8_w/toolchains-darwin-arm64-3.2.3.6-Release.zip...
> hvigor Unzipping /Users/xxx/Library/Huawei/Sdk/.temp/toolchains/3.2.3.6/install/toolchains-darwin-arm64-3.2.3.6-Release.zip...
> hvigor Moving the SDK...
> hvigor Install task finished: Toolchains 3.2.3.6
> hvigor Finished :entry:init... after 2 ms 
> hvigor Finished ::init... after 1 ms 

Process finished with exit code 0

运行App

The type of the target device does not match the deviceType configured in the module.json5 file of the selected module.

查了几个文档依然没有解决问题,好挫败啊

developer.huawei.com/consumer/cn…

blog.csdn.net/Calvin_zhou…

developer.huawei.com/consumer/cn…

我心想是不是没有模拟器、打算去下载一个模拟器,然后提示我需要先下载系统,玩呢?

4111703732160_.pic.jpg

然后我把这一堆都下载了

4131703732430_.pic.jpg

然后就安装了这个

4141703732669_.pic.jpg

可是我还么有运行起来程序,我累了。。。