node 编译遇到 Exit status 137问题解决

问题描述

在虚拟机执行npm run build执行打包文件时候一直失败,然而在windows上就没有这个问题

解决途径

  • 加上管理员权限 sudo npm run build
  • google找到两篇解决方案(npm ERR! weird error 137, npm install fails on Digital Ocean Ubuntu)

    其中关键引用:

    ① I’m getting this now. I’m fairly certain it’s because the server is running out of available memory.Gonna bump up my droplet from 2GB to 4GB and give this another go.Update: yep, this was down to lack of memory. I’m guessing that @wingchi rebooting freed up some memory and so that was why it fixed his issue.

    ② You need more ram. See all the closed issues about digital ocean for moredetails.

    ③ The problem is not with the unzipping, the problem is that we need RAM to store the complete data structure in memory at all times in order for geoip to do fast lookups. If we do not store this in memory, then lookups become slower because we’ll keep going to disk to read the file.

    ④ Alternative is to run the update on a bigger machine and then push the data files to all the servers needing the update.

    简而言之就是:你需要更多的内存

    之前我给CPU分配的内存是512M,改成1024就可以正常编译了

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值