vue 热更新内存溢出
Posted amang
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了vue 热更新内存溢出相关的知识,希望对你有一定的参考价值。
就是保存时会出错
> node –max_old_space_size=4096 webpack-dev-server --inline --progress --config build/webpack.dev.conf.js module.js:549 throw err; ^ Error: Cannot find module ‘F:work路径路径vue–max_old_space_size=4096‘ at Function.Module._resolveFilename (module.js:547:15) at Function.Module._load (module.js:474:25) at Function.Module.runMain (module.js:693:10) at startup (bootstrap_node.js:188:16) at bootstrap_node.js:609:3 npm ERR! code ELIFECYCLE npm ERR! errno 1 npm ERR! [email protected] dev: `node –max_old_space_size=4096 webpack-dev-server --inline --progress --config build/webpack.dev.conf.js` npm ERR! Exit status 1 npm ERR! npm ERR! Failed at the [email protected] 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:Program Files odejsX64 ode_cache\_logs2018-09-04T07_52_06_975Z-debug.log
解决方法:
windows 下的 vue 项目 dev 环境可以加到 找到一下路径
./node_modules/.bin/webpack-dev-server.cmd
添加 --max-old-space-size=4096
@IF EXIST "%~dp0 ode.exe" ( "%~dp0 ode.exe" "%~dp0..webpack-dev-serverinwebpack-dev-server.js" %* ) ELSE ( @SETLOCAL @SET PATHEXT=%PATHEXT:;.JS;=;% node --max-old-space-size=4096 "%~dp0..webpack-dev-serverinwebpack-dev-server.js" %* )
以上是关于vue 热更新内存溢出的主要内容,如果未能解决你的问题,请参考以下文章