鸿蒙OS导入项目报错不能运行 @ohos\hvigor\bin\hvigor.js‘

在自学HarmonyOS时,想在DevEco Studio导入官方示例代码:**待办列表(ArkTS)**报错

C:\Users\woods\Downloads\test01\ToDoListArkTS\node_modules\@ohos\hvigor\bin\hvigor.js --mode module -p module=entry@default -p product=default -p compileResInc=true -p buildRoot=.preview -p previewMode=true buildPreviewerResource

node:internal/modules/cjs/loader:1024

throw err;

^

Error: Cannot find module 'C:\Users\woods\Downloads\test01\ToDoListArkTS\node_modules\@ohos\hvigor\bin\hvigor.js'

at Function.Module._resolveFilename (node:internal/modules/cjs/loader:1021:15)

at Function.Module._load (node:internal/modules/cjs/loader:866:27)

at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)

at node:internal/main/run_main_module:22:47 {

code: 'MODULE_NOT_FOUND',

requireStack: []

}

Process finished with exit code 1

点击右上角的 Notification 通知面板

这有个提示报错提示,大致意思是版本不一致

Sync failed. Follow the given solution

import导入时界面报错,直接点击解决方案,执行命令安装指定版本

安装好依赖又报这个错,看意思应该是只有页面文件才可以运行

找到要运行的ets页面

这样我们导入的项目就可以运行了

相关推荐
zhongcx9 小时前
鸿蒙应用示例:ArkTS UI框架中的文本缩进技巧
harmonyos
东林知识库10 小时前
鸿蒙NEXT开发-自定义构建函数(基于最新api12稳定版)
华为·harmonyos
裴云飞16 小时前
鸿蒙性能优化之布局优化
性能优化·harmonyos
zhongcx16 小时前
鸿蒙应用示例:ArkTS中设置颜色透明度与颜色渐变方案探讨
harmonyos
真正的醒悟17 小时前
华为资源分享
运维·服务器·华为
PlumCarefree1 天前
mp4(H.265编码)转为本地RTSP流
音视频·harmonyos·h.265
鸿蒙自习室1 天前
鸿蒙网络管理模块04——网络连接管理
华为·harmonyos·鸿蒙·媒体
小Q的编程笔记1 天前
HarmonyOS:AVPlayer 与 XComponent 联手打造定制化视频播放器
harmonyos
Yeats_Liao1 天前
华为开源自研AI框架昇思MindSpore应用案例:计算高效的卷积模型ShuffleNet
人工智能·深度学习·华为
cn_mengbei1 天前
HUAWEI New4.9G 与 2.6G 无法正常切换问题处理案例
网络·华为