最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - How to set max-old-space-size for typescript compiler (tsc)? - Stack Overflow

programmeradmin0浏览0评论

I have tsc job failing on gitlab ci with FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

The script I'm running is tsc -p test/tsconfig.json --noEmit

What I've tried so far is to increase max-old-space-size via:

  1. cross-env NODE_OPTIONS=--max-old-space-size=8192 yarn print:heapsize && tsc -p test/tsconfig.json --noEmit
  2. cross-env NODE_OPTIONS='--max-old-space-size=8192' yarn print:heapsize && tsc -p test/tsconfig.json --noEmit (just extra quotes around var)
  3. node --max-old-space-size=8192 ./node_modules/.bin/tsc -p test/tsconfig.json --noEmit

Options #1 and #2 doesn't work, and #3 works fine, but it doesn't sound okay to me to run the binary and pass param to the node cli

So my question is - how do I set max-old-spce-size for tsc via env variables or maybe there is another good way to do it?

yarn print:heapsize is the script I used to check current size - it shows 8gb for both #1 and #2 here it is:

"print:heapsize": "node -e \"console.log('

发布评论

评论列表(0)

  1. 暂无评论