JavaScript heap out of memory
Workaround to fix heap out of memory when running node binaries. It's a common issue when using TypeScript 2.1+ and webpack.
This tool will append --max-old-space-size=4096 in all node calls inside your node_modules/.bin/* files.
- 全局安装
increase-memory-limit
npm install -g increase-memory-limit
- 进入工程目录,执行 :
increase-memory-limit
- 如出现错误提示
'node --max-old-space-size=10240' 不是内部或外部命令,也不是可运行的程序,仅需在node_modules文件夹中将所有"%_prog%"替换成%_prog%(即去掉双引号)
注意:Node.js v8.0 以上可以按照下面方式设定,不需要使用插件了
export NODE_OPTIONS=--max_old_space_size=4096
作者:李霖弢
链接:https://www.jianshu.com/p/c18aa1039480
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。