在自学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
1.点击右上角的 notification 通知面板
这有个提示报错提示,大致意思是版本不一致
sync failed. follow the given solution
2.import导入时界面报错,直接点击解决方案,执行命令安装指定版本
3.安装好依赖又报这个错,看意思应该是只有页面文件才可以运行
4.找到要运行的ets页面,再次运行一下
这样我们导入的项目就可以运行了
发表评论