angular - 由于内存问题,compodoc 未生成图形

运行命令“npm run compodoc”并看到这个问题:

Error during graph generation: : abort("Cannot enlarge memory arrays. Either (1) compile with -s TOTAL_MEMORY=X with X higher than the current value 16777216, (2) compile with -s ALLOW_MEMORY_GROWTH=1 which allows increasing the size at runtime but prevents some optimizations, (3) set Module.TOTAL_MEMORY to a higher value before the program runs, or (4) if you want malloc to return NULL (0) instead of this abort, compile with -s ABORTING_MALLOC=0 "). Build with -s ASSERTIONS=1 for more info.

有人知道如何在这里正确增加内存大小以使其工作吗?现在,它生成组件文档,但不生成路由文档(猜测这与图形生成的内存问题有关)

最佳答案

你试过下面这个片段吗

node --max_old_space_size=8192 node_modules/.bin/compodoc -p ./tsconfig.json -t --config compodoc.json

我已经定义了一个 compodoc json 文件,其中已经添加了大部分配置。

仅供引用

  • node --max-old-space-size=1024 <...> #increase to 1gb
  • node --max-old-space-size=2048 <...> #increase to 2gb
  • node --max-old-space-size=3072 <...> #increase to 3gb
  • node --max-old-space-size=4096 <...> #increase to 4gb
  • node --max-old-space-size=5120 <...> #increase to 5gb
  • node --max-old-space-size=6144 <...> #increase to 6gb
  • node --max-old-space-size=7168 <...> #increase to 7gb
  • node --max-old-space-size=8192 <...> #increase to 8gb

希望这对您有所帮助。

https://stackoverflow.com/questions/54988744/

相关文章:

php - 如何使用 php 代码在 WHM/Cpanel 中以编程方式创建数据库?

ionic-framework - Ionic3 - 电子邮件编辑器 - 对象(...)不是函数

c# - .NET Core 2 中的 Startup.cs 中的 "IConfiguration

javascript - 使用 css 或 html5 的置换贴图

c++ - Cmake 仅包含 header 目标来自仅 header 目标

debugging - 如何从 Web 应用程序连接本地托管的 Azure BOT

unity3d - 应该如何使用 Unity 的 ExecuteEvents.Execute?

kubernetes - 如何在 OSX 上使用 Kubernetes 持久本地卷和 Minikub

javascript - 使 postcss 与 material ui 的 jss 一起工作

android - 在自定义 Camera2 API 上显示矩形边界框(覆盖),以便仅捕获框内的图像