{"id":1351,"date":"2025-08-19T18:37:34","date_gmt":"2025-08-19T09:37:34","guid":{"rendered":"https:\/\/shinke1987.net\/?p=1351"},"modified":"2025-08-19T18:37:34","modified_gmt":"2025-08-19T09:37:34","slug":"npm-run-build%e6%99%82%e3%81%aeheap-out-of-memory%e3%82%a8%e3%83%a9%e3%83%bc%e3%81%b8%e3%81%ae%e5%af%be%e5%bf%9c%e3%83%ad%e3%82%b0","status":"publish","type":"post","link":"https:\/\/shinke1987.net\/?p=1351","title":{"rendered":"npm run build\u6642\u306eheap out of memory\u30a8\u30e9\u30fc\u3078\u306e\u5bfe\u5fdc\u30ed\u30b0"},"content":{"rendered":"\n<h2 id=\"toc0\" class=\"wp-block-heading\">\u767a\u7aef<\/h2>\n\n\n\n<p>npm run build\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001<\/p>\n\n\n\n<p>\u30b9\u30ef\u30c3\u30d7\u9818\u57df\u304c\u7d042GB\u3042\u308a\u3001\u307b\u307c\u4f7f\u308f\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u554f\u984c\u7121\u3055\u305d\u3046\u3060\u3051\u3069\u4e0b\u8a18\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nFATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory\n----- Native stack trace -----\n\n 1: 0xe36196 node::OOMErrorHandler(char const*, v8::OOMDetails const&amp;amp;) &#x5B;node]\n 2: 0x123f4a0 v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, v8::OOMDetails const&amp;amp;) &#x5B;node]\n 3: 0x123f777 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, v8::OOMDetails const&amp;amp;) &#x5B;node]\n 4: 0x146d1a5  &#x5B;node]\n 5: 0x1486a19 v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) &#x5B;node]\n 6: 0x145b0e8 v8::internal::HeapAllocator::AllocateRawWithLightRetrySlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) &#x5B;node]\n 7: 0x145c015 v8::internal::HeapAllocator::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) &#x5B;node]\n 8: 0x1434cee v8::internal::Factory::NewFillerObject(int, v8::internal::AllocationAlignment, v8::internal::AllocationType, v8::internal::AllocationOrigin) &#x5B;node]\n 9: 0x18962ec v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) &#x5B;node]\n10: 0x1df2476  &#x5B;node]\n\u4e2d\u6b62 (\u30b3\u30a2\u30c0\u30f3\u30d7)\n<\/pre><\/div>\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067Node.js\u306e\u30d2\u30fc\u30d7\u30e1\u30e2\u30ea\u5236\u9650\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u7d50\u679c\u306f396MB\u3060\u3063\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nnode -e &#039;console.log(Math.floor(v8.getHeapStatistics().heap_size_limit\/1024\/1024))&#039;\n<\/pre><\/div>\n\n\n<h2 id=\"toc1\" class=\"wp-block-heading\">\u89e3\u6c7a<\/h2>\n\n\n\n<p>\u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3057\u3001\u4e00\u6642\u7684\u306b\u30e1\u30e2\u30ea\u3092\u7d041GB\uff08\u30b9\u30ef\u30c3\u30d7\u9818\u57df\u306e\u534a\u5206\uff09\u4f7f\u3046\u3088\u3046\u8a2d\u5b9a\u3057\u305f\u3089\u3001\u7121\u4e8b\u30d3\u30eb\u30c9\u3067\u304d\u305f\u3002<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: plain; title: ; notranslate\" title=\"\">\nNODE_OPTIONS=&quot;--max-old-space-size=1024&quot; npm run build\n<\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>\u767a\u7aef npm run build\u30b3\u30de\u30f3\u30c9\u3092\u5b9f\u884c\u3059\u308b\u3068\u3001 \u30b9\u30ef\u30c3\u30d7\u9818\u57df\u304c\u7d042GB\u3042\u308a\u3001\u307b\u307c\u4f7f\u308f\u308c\u3066\u3044\u306a\u304b\u3063\u305f\u306e\u3067\u554f\u984c\u7121\u3055\u305d\u3046\u3060\u3051\u3069\u4e0b\u8a18\u30a8\u30e9\u30fc\u304c\u8868\u793a\u3055\u308c\u305f\u3002 \u4e0b\u8a18\u30b3\u30de\u30f3\u30c9\u3067Node.js\u306e\u30d2\u30fc\u30d7\u30e1\u30e2\u30ea\u5236\u9650\u3092\u78ba\u8a8d\u3059\u308b\u3068\u3001\u7d50\u679c\u306f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[104],"tags":[105],"class_list":["post-1351","post","type-post","status-publish","format-standard","hentry","category-react","tag-react"],"_links":{"self":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1351","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1351"}],"version-history":[{"count":1,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1351\/revisions"}],"predecessor-version":[{"id":1352,"href":"https:\/\/shinke1987.net\/index.php?rest_route=\/wp\/v2\/posts\/1351\/revisions\/1352"}],"wp:attachment":[{"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1351"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1351"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/shinke1987.net\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1351"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}