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

标签 angular npm runtime-error npm-scripts 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

希望这对您有所帮助。

关于angular - 由于内存问题,compodoc 未生成图形,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54988744/

相关文章:

javascript - 应用状态接口(interface)中的 NgRx 根状态键

angular - Docker/bin/sh : 1: ng: not found (Angular)

reactjs - 在 React Native 中在哪里添加 .d.ts 文件

javascript - grunt 替换时出现目标未定义错误

Javascript 运行时错误 :

c# - 如何在没有 Build "Errors"的情况下将 Angular-CLI 与 Visual Studio 2017 一起使用

angular - ng serve 不自动检测文件更改

npm - require ('yeoman-generator' ).generators.Base 已弃用

c++ - 如何从系统日期获取昨天的日期并附加到字符串?

jquery - 错误消息显示意外的尖括号,但不应有意外的尖括号