LoginSignup
1
1

More than 3 years have passed since last update.

Vue CLIでビルド時にメモリ不足になった場合の対処

Last updated at Posted at 2020-07-01

スタックトレースの例

<--- JS stacktrace --->
...省略...

FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory

対応

Node.jsのオプションでメモリサイズを拡張します。
package.jsonに埋め込んでもいいですし、

package.json
"build": "node --max_old_space_size=4096 node_modules/@vue/cli-service/bin/vue-cli-service.js build ",

環境変数で設定してもOK

set or export NODE_OPTIONS=--max_old_space_size=4096
1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1