HarmonyOS鸿蒙Next中hvigor ERROR: Error, Cannot find module '@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor'
HarmonyOS鸿蒙Next中hvigor ERROR: Error, Cannot find module ‘@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor’ DevEco Studio 5.0.2 Release 打开老项目(基于 DevEco Studio 5.0.1 Release 创建),编辑报这个错:
D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\node\node.exe D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\hvigor\bin\hvigorw.js clean --mode module -p product=default assembleHap --analyze=normal --parallel --incremental --daemon
> hvigor hvigor client: Starting hvigor daemon.
> hvigor Hvigor Daemon started in 1.87 s
> hvigor ERROR: Error, Cannot find module '[@ohos](/user/ohos)/hvigor-ohos-plugin/src/utils/log/log-adaptor'
Require stack:
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\src\task\cangjie-pre-build.js
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\src\task\cangjie-task-initializer.js
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\src\plugin\base-cangjie-plugin.js
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\src\plugin\cangjie-hap-plugin.js
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\src\plugin\cangjie-plugin-factory.js
- C:\Users\wayla.hvigor\project_caches\025693b40416664b468899595dea8b93\workspace\node_modules.pnpm\file+D++workspace+gitee+develop-native-harmonyos-a_iz5k7vaemjwnkkiyompgabo25m\node_modules\cangjie-build-support\index.js
- D:\workspace\gitee\develop-native-harmonyos-ai-assistant-with-cangjie-video\samples\ch11\CangjieAiAssistant\hvigorfile.ts
- D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\hvigor\hvigor\src\base\internal\lifecycle\configuration.js
- D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\hvigor\hvigor\src\base\boot\index.js
- D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\hvigor\hvigor\src\base\daemon\cluster\worker-process-lifecycle.js
- D:\dev\harmonyos\deveco\devecostudio-windows-5.0.7.210\tools\hvigor\hvigor\src\base\daemon\process\daemon-process-boot-script.js in hvigorfile: D:\workspace\gitee\develop-native-harmonyos-ai-assistant-with-cangjie-video\samples\ch11\CangjieAiAssistant\hvigorfile.ts
> hvigor ERROR: BUILD FAILED in 1 s 640 ms
Process finished with exit code -1
更多关于HarmonyOS鸿蒙Next中hvigor ERROR: Error, Cannot find module '@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor'的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS鸿蒙Next中,hvigor
构建工具出现ERROR: Error, Cannot find module '@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor'
错误,通常是由于依赖模块缺失或路径配置不正确导致的。具体原因可能是hvigor-ohos-plugin
插件未正确安装,或项目配置文件中引用的模块路径错误。解决此问题需确保项目依赖完整且路径配置准确,检查hvigor
配置文件和项目依赖关系,确保相关插件已正确安装并引用。
更多关于HarmonyOS鸿蒙Next中hvigor ERROR: Error, Cannot find module '@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor'的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
在HarmonyOS鸿蒙Next开发中,出现hvigor ERROR: Error, Cannot find module '@ohos/hvigor-ohos-plugin/src/utils/log/log-adaptor'
错误,通常是由于依赖模块缺失或路径配置不正确导致的。建议您执行以下步骤进行排查和修复:
-
检查依赖:确保
@ohos/hvigor-ohos-plugin
已正确安装,可以通过npm install
或yarn install
重新安装依赖。 -
清理缓存:运行
hvigor clean
清理构建缓存,然后重新构建项目。 -
检查路径:确认
log-adaptor
模块的路径是否正确,必要时手动调整或重新安装相关插件。 -
更新工具:确保使用的
hvigor
和HarmonyOS SDK
是最新版本,避免因版本不兼容导致的问题。
如果问题仍未解决,建议查阅官方文档或社区论坛获取更多帮助。