运行命令“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/