zfile-dev / zfile-vue

zfile 前端工程
MIT License
466 stars 273 forks source link

怎么打包啊 打包报错了 npm run build #67

Open Jesse54211 opened 1 year ago

Jesse54211 commented 1 year ago

怎么打包啊 打包报错了 npm run build image

zhaojun1998 commented 1 year ago

@Jesse54211

报错信息是:JavaScript heap out of memory,可根据此关键词搜索问题,大概意思是内存不足。

可参考:

同时我使用一个纯净的 Linux 环境,新配置环境也编译通过了,相关版本以供参考:

[root@VM-24-8-centos ~]# node -v
v16.17.0
[root@VM-24-8-centos ~]# yarn -v
1.22.19
[root@VM-24-8-centos ~]# uname -a
Linux VM-24-8-centos 3.10.0-1160.71.1.el7.x86_64 #1 SMP Tue Jun 28 15:37:28 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
[root@VM-24-8-centos ~]# free -m
              total        used        free      shared  buff/cache   available
Mem:           3693         251        2272           0        1170        3151
Swap:             0           0           0
[root@VM-24-8-centos ~]# 
zhaojun1998 commented 1 year ago

@Jesse54211

我又去 vite 的 issue 里找到了一篇讨论这个问题的,目前看来可能是 vite 的 bug,也可能是引用的某个依赖的 bug,目前这个还没有定论,基本原因是内存泄漏导致编译时需要大量内存,我开发机内存 32G,所以没遇到这个问题,但我会持续关注此问题并进行反馈。

c100515 commented 1 year ago

一样 也是报内存不足