codestates / codestates/Bobpago

[๐ŸšจErr Handling] AWS EC2์— NestJS ๋ฐฐํฌํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ

Open
#108 0 comments 0 reactions 1 assignee Claimed by @tjdgns5272 View on GitHub
complete error handling
Dominant language
TypeScript
Stars
5
Forks
3
PR merge metrics
No merged PRs in 30d

Description

### ์–ด๋–ค ์—๋Ÿฌ์ธ๊ฐ€์š”?
- ec2์— NestJs npm run build๋ฅผ ํ†ตํ•ด distํด๋” ๋งŒ๋“ค๋•Œ ์ƒ๊ธฐ๋Š” ์˜ค๋ฅ˜
- ec2์— ํ”„๋กœ์ ํŠธ ์•ฑ์„ ํด๋ก  ๋ฐ›์€ ํ›„์— npm rub build๋ฅผ ํ•˜๋ฉด distํด๋”๊ฐ€ ์ƒ์„ฑ๋˜์•ผํ•˜๋Š”๋ฐ ์˜ค๋ž˜๋™์•ˆ ๋ฉˆ์ถฐ์žˆ๋‹ค๊ฐ€ heap out of memory ์—๋Ÿฌ๊ฐ€ ๋œฌ๋‹ค.

### ์—๋Ÿฌ ๋ฉ”์‹œ์ง€

```bash
$ FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
```

### ์—๋Ÿฌ ํ•ธ๋“ค๋ง ๋ฐฉ๋ฒ•

- ์ฒ˜์Œ์—” ์šฉ๋Ÿ‰์„ ๋Š˜๋ ค์ค„์ˆ˜ ์žˆ๋Š” ๋ฐฉ๋ฒ•์— ๋Œ€ํ•ด ์ฐพ์•„๋ณด์•˜์œผ๋‚˜, ์ฝ”๋“œ ๋‚ด๋ถ€์ ์œผ๋กœ ๋ฌธ์ œ๊ฐ€ ์žˆ์„๊ฑฐ๊ฐ™๋‹ค๊ณ  ์ƒ๊ฐํ•ด์„œ ์ข€๋” ๊ตฌ๊ธ€๋ง์„ ํ•ด๋ดค๋‹ค.
- ec2 ๊ฐ€์ƒํ™˜๊ฒฝ์—์„œ๋Š” nest ๋ช…๋ น์–ด๋ฅผ ์ธ์‹ํ•˜์ง€ ๋ชปํ•œ๋‹ค๋Š” ์ •๋ณด๋ฅผ ์•Œ๊ฒŒ๋˜์–ด์„œ, dist ํด๋”๋ฅผ ๋กœ์ปฌ์—์„œ ์ƒ์„ฑ ํ›„ package.jsonํŒŒ์ผ์„ ์•ˆ์— ๋ณต์‚ฌ๋ฅผ ํ•ด์ฃผ๊ณ  ec2์— ํ”„๋กœ์ ํŠธ ๋””๋ ‰ํ† ๋ฆฌ ๋‚ด๋ถ€์— ์ง์ ‘ ์ฃผ์ž… ์‹œ์ผฐ๋‹ค.
- ๊ทธ ๊ฒฐ๊ณผ ์„œ๋ฒ„๊ฐ€ ์ •์ƒ์ ์œผ๋กœ ์ž‘๋™๋ฌ๋‹ค.

### ์—๋Ÿฌ ํ•ธ๋“ค๋ง์„ ์œ„ํ•ด ์ฐธ๊ณ ํ•œ ๋ ˆํผ๋Ÿฐ์Šค ๋งํฌ

[https://stackoverflow.com/questions/54737166/how-to-generate-a-production-build-of-an-api-done-with-nestjs](https://stackoverflow.com/questions/54737166/how-to-generate-a-production-build-of-an-api-done-with-nestjs)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.