umijs / umi

A framework in react community ✨
https://umijs.org
MIT License
15.39k stars 2.65k forks source link

在jenkins自动化部署的时候打包出错。 #5434

Closed insistenceZHUO closed 4 years ago

insistenceZHUO commented 4 years ago

`+ node -v v12.18.0

最后提示错误: Killed error Command failed with exit code 137. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command. Build step 'Execute shell' marked build as failure

insistenceZHUO commented 4 years ago

后台给的反馈是,在打包的时候,内存溢出了,我尝试在 package.json中添加:

"scripts": { "build": "umi build node --max-old-space-size=80000", }

去加载node的内存,但也是失败的

xiaohuoni commented 4 years ago

是要加环境变量 NODE_OPTIONS=--max_old_space_size=4096 不是 --max_old_space_size=4096。 你试试

"scripts": {
  "build": "NODE_OPTIONS=--max_old_space_size=4096 umi build ",
}
sorrycc commented 4 years ago

试试这个,https://umijs.org/guide/boost-compile-speed#%E6%9B%BF%E6%8D%A2%E5%8E%8B%E7%BC%A9%E5%99%A8%E4%B8%BA-esbuild

insistenceZHUO commented 4 years ago

是要加环境变量 NODE_OPTIONS=--max_old_space_size=4096 不是 --max_old_space_size=4096。 你试试

"scripts": {
  "build": "NODE_OPTIONS=--max_old_space_size=4096 umi build ",
}

改为:

"build": "NODE_OPTIONS=--max_old_space_size=4096 umi build ",

还是不行

indown commented 3 years ago

是要加环境变量 NODE_OPTIONS=--max_old_space_size=4096 不是 --max_old_space_size=4096。 你试试

"scripts": {
  "build": "NODE_OPTIONS=--max_old_space_size=4096 umi build ",
}

改为:

"build": "NODE_OPTIONS=--max_old_space_size=4096 umi build ",

还是不行

请问下最后怎么解决的

insistenceZHUO commented 3 years ago

后面让服务器加内存好了

chj-damon commented 4 months ago

我也遇到这个问题了。。。