Je viens d'acheter un nouveau ecs.n4.small
à Hongkong avec 1 vCPU 2 GiB
.
Dans le serveur, j'ai cloné git un projet React qui peut être bien construit localement, puis j'ai fait yarn
y yarn build
. Après 3 minutes, il est revenu :
yarn build
yarn run v1.22.4
$ react-scripts --max_old_space_size=8096 build
Setting NODE_PATH to resolve modules absolutely has been deprecated in favor of setting baseUrl in jsconfig.json (or tsconfig.json if you are using TypeScript) and will be removed in a future major release of create-react-app.
Creating an optimized production build...
The build failed because the process exited too early. This probably means the system ran out of memory or someone called `kill -9` on the process.
En /var/log/syslog
J'ai trouvé :
May 1 08:34:45 AliYun kernel: [46379.316865] [25517] 0 25517 193946 6641 130 76 0 0 node
May 1 08:34:45 AliYun kernel: [46379.316867] [25538] 0 25538 1126 18 7 3 0 0 sh
May 1 08:34:45 AliYun kernel: [46379.316869] [25539] 0 25539 113703 1697 63 27 0 0 node
May 1 08:34:45 AliYun kernel: [46379.316871] [25546] 0 25546 629715 439566 6497 6041 0 0 node
May 1 08:34:45 AliYun kernel: [46379.316873] Out of memory: Kill process 25546 (node) score 856 or sacrifice child
May 1 08:34:45 AliYun kernel: [46379.317613] Killed process 25546 (node) total-vm:2518860kB, anon-rss:1757868kB, file-rss:396kB
May 1 08:35:01 AliYun CRON[25570]: (root) CMD (command -v debian-sa1 > /dev/null && debian-sa1 1 1)
Quelqu'un sait-il ce que je dois changer pour activer yarn build
travailler dans un serveur ?