JavaScript heap out of memory解决方法

在 npm 打包的时候,node环境控制台报错了,JavaScript heap out of memory

解决方法如下:

不管你是angular还是其他的,找到

ode_modules.binxxx.cmd

如果是angular,那就找ng.cmd 

如果是ant-design-pro,那就找roadhog.cmd

加上这个

--max_old_space_size=8192

修改如下:
@IF EXIST "%~dp0
ode.exe" (
  "%~dp0
ode.exe" --max_old_space_size=8192  "%~dp0..._@angular_cli@1.0.0@@angularcliin
g" %*
) ELSE (
  @SETLOCAL
  @SET PATHEXT=%PATHEXT:;.JS;=;%
  node --max_old_space_size=8192  "%~dp0..._@angular_cli@1.0.0@@angularcliin
g" %*
)


//
原文地址:https://www.cnblogs.com/ldld/p/9054109.html