hvigor HarmonyOS 鸿蒙Next ERROR Worker terminated due to reaching memory limit JS heap out of memory
hvigor HarmonyOS 鸿蒙Next ERROR Worker terminated due to reaching memory limit JS heap out of memory
> hvigor Finished :entry:default@BuildNativeWithNinja... after 11 s 178 ms
> hvigor UP-TO-DATE :entry:default@ProcessLibs...
> hvigor ERROR: Failed :entry:default@CompileArkTS...
> hvigor ERROR: Worker terminated due to reaching memory limit: JS heap out of memory
> hvigor ERROR: BUILD FAILED in 48 s 438 ms
更多关于hvigor HarmonyOS 鸿蒙Next ERROR Worker terminated due to reaching memory limit JS heap out of memory的实战教程也可以访问 https://www.itying.com/category-93-b0.html
楼主解决了吗,这个问题我也遇到了
更多关于hvigor HarmonyOS 鸿蒙Next ERROR Worker terminated due to reaching memory limit JS heap out of memory的实战系列教程也可以访问 https://www.itying.com/category-93-b0.html
“setting"搜索"hvigor”,勾选"Execute tasks in parallel mode"、"Re-execute the task in incremental mode"两个选项
试了还是不行呀大佬 还有其他解决办法吗
在这个设置中下面有一个 "Enable the Daemon for tasks"的设置,不要勾选,
大佬我找到原因了。我复制的https://developer.harmonyos.com/cn/docs/documentation/doc-guides/ets-restriction-and-extension-0000001417392049这里的$$例子,组件名和属性名都为bindPopup,修改组件名后就运行正常了。感谢大佬!
我也遇到了,咋解决的啊
hvigor是鸿蒙Next的构建工具,用于管理项目的构建和依赖。出现"Worker terminated due to reaching memory limit JS heap out of memory"错误,通常是由于Node.js进程的内存不足导致的。在鸿蒙Next项目中,hvigor依赖于Node.js来执行构建任务,当项目规模较大或构建过程中内存消耗过多时,可能会触发Node.js的内存限制。
Node.js默认的内存限制为1.4GB(32位系统)或2GB(64位系统)。要解决此问题,可以通过增加Node.js的内存限制来避免JS堆内存耗尽。可以通过在命令行中设置--max-old-space-size
参数来调整内存限制,例如:
node --max-old-space-size=4096 hvigorw assemble
此命令将Node.js的内存限制增加到4GB。根据项目需求,可以继续调整该值。
此外,确保开发环境中的Node.js版本与鸿蒙Next的要求兼容,避免因版本不匹配导致的异常内存消耗。如果问题仍然存在,可以尝试优化构建脚本或减少并行任务的数量,以降低内存使用。