vue打包内存溢出问题解决

一、问题描述

FATAL ERROR: MarkCompactCollector: young object promotion failed Allocation failed - JavaScript heap out of memory
npm ERR! code ELIFECYCLE
npm ERR! errno 134
npm ERR! study-model-dmo@1.0.0 dev: `webpack-dev-server --inline --progress --config build/webpack.dev.conf.js`
npm ERR! Exit status 134
npm ERR!
npm ERR! Failed at the study-model-dmo@1.0.0 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!     D:\work\tools\node\node_cache\_logs\2021-07-06T01_29_07_637Z-debug.log

二、解决方案

1、全局安装 increase-memory-limit

npm install -g increase-memory-limit

2、在项目中执行命令

increase-memory-limit

3、在node_module下的.bin文件夹中查找"%_prog%",并替换为%_prog%(去掉双引号)

image.png

4、重启编辑器,重新执行命令

npm run devnpm run build

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容