200223-npm 打包溢出 FATAL ERROR Ineffective mark-compacts near heap limit Allocation failed

hexo打包上传博文时,忽然报了一个致命错误,FATAL ERROR: Ineffective mark-compacts near heap limit Allocation failed 堆内存不够

一个简单的解决办法

1
export NODE_OPTIONS="--max-old-space-size=8192"

或者直接在.bash_profile文件中配置,并全局生效

1
2
3
4
5
6
7
8
vim ~/.bash_profile

# 新增,并保存退出
export NODE_OPTIONS="--max-old-space-size=8192"


# 生效
source ~/.bash_profile
Your browser is out-of-date!

Update your browser to view this website correctly. Update my browser now

×