Windows10
ローカルサーバーは、Amppsです。
Laravelのプロジェクトのルートディレクトリで、
npm run development
のコマンドを実行すると以下のようなエラーになります。
<--- JS stacktrace ---> ==== JS stack trace ========================================= 0: ExitFrame [pc: 000000FE97ADC5C1] Security context: 0x01dbf451e6e9 <JSObject> 1: /* anonymous */(aka /* anonymous */) [000000A911F461A9] [D:\Ampps\www\project\node_modules\prettier\index.js:~12511] [pc=000000FE9843AA94](this=0x02f39c2026f1 <undefined>,part=0x024f64b0a2a9 <Object map = 000002BCD3074CF1>) 2: arguments adaptor frame: 3->1 3: map [000001DBF4506E61](this=0x024f64b0a2d1 <JSArray[1]>,0x00a911f... FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed - JavaScript heap out of memory 1: 00007FF7279FDD8A v8::internal::GCIdleTimeHandler::GCIdleTimeHandler+4506 2: 00007FF7279D8886 node::MakeCallback+4534 3: 00007FF7279D9200 node_module_register+2032 4: 00007FF727CF30DE v8::internal::FatalProcessOutOfMemory+846 5: 00007FF727CF300F v8::internal::FatalProcessOutOfMemory+639 6: 00007FF727ED9804 v8::internal::Heap::MaxHeapGrowingFactor+9620 7: 00007FF727ED07E6 v8::internal::ScavengeJob::operator=+24550 8: 00007FF727ECEE3C v8::internal::ScavengeJob::operator=+17980 10: 00007FF727ED7C06 v8::internal::Heap::MaxHeapGrowingFactor+2454 11: 00007FF728001EA7 v8::internal::Factory::NewFillerObject+55 12: 00007FF72807F096 v8::internal::operator<<+73494 13: 000000FE97ADC5C1 npm ERR! code ELIFECYCLE npm ERR! errno 134 npm ERR! @ development: `cross-env NODE_ENV=development node_modules/webpack/bin/webpack.js --progress --hide-modules --config=node_modules/laravel-mix/setup/webpack.config.js` npm ERR! Exit status 134 npm ERR! npm ERR! Failed at the @ development script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\_logs\2019-12-05T11_33_27_782Z-debug.log npm ERR! code ELIFECYCLE npm ERR! errno 134 npm ERR! @ dev: `npm run development` npm ERR! Exit status 134 npm ERR! npm ERR! Failed at the @ dev script. npm ERR! This is probably not a problem with npm. There is likely additional logging output above. npm ERR! A complete log of this run can be found in: npm ERR! C:\2019-12-05T11_33_27_847Z-debug.log
package.json のオプションへ、
NODE_OPTIONS=--max_old_space_size=2048
を追記すれば実行できますが、nodejs の環境変数へ直接設定したいと思っています。
数時間調べてみたのですが、方法がわからず、お分かりの方にご教示いただきたいです。
何卒よろしくお願いいたします。