codestates / codestates/AnimalChat

[Error Handling] 서버 자동배포 실행 문제

Open
#86 0 comments 0 reactions 0 assignees View on GitHub
error server
Dominant language
JavaScript
Stars
0
Forks
3
PR merge metrics
No merged PRs in 30d

Description

## 어떤 에러인가요?
- 서버 자동화 배포 파이프라인 구축을 완료하고 ec2 서버로 접속하고 실행했으나 오류로그가 뜨고, 서버 실행이 안됨.

## 에러 메시지
- 어제 떴던 에러 메세지
```jsx
# Logfile created on 2021-10-07 08:08:53 +0000 by logger.rb/61378
[2021-10-07 08:08:53.473] [d-TXYOTNVI0]LifecycleEvent - AfterInstall
[2021-10-07 08:08:53.473] [d-TXYOTNVI0]Script - scripts/initialize.sh
[2021-10-07 08:08:55.407] [d-TXYOTNVI0][stderr]WARN engine dotenv@10.0.0: wanted: {"node":">=10"} (curren$
[2021-10-07 08:08:56.056] [d-TXYOTNVI0][stderr]WARN engine sequelize-cli@6.2.0: wanted: {"node":">=10.0.0$
[2021-10-07 08:08:56.296] [d-TXYOTNVI0][stderr]WARN engine sequelize@6.6.5: wanted: {"node":">=10.0.0"} ($
[2021-10-07 08:09:06.592] [d-TXYOTNVI0][stderr]WARN engine lru-cache@6.0.0: wanted: {"node":">=10"} (curr$
[2021-10-07 08:09:07.502] [d-TXYOTNVI0][stderr]WARN engine semver@7.3.5: wanted: {"node":">=10"} (current$
[2021-10-07 08:09:08.234] [d-TXYOTNVI0][stderr]WARN engine sequelize-pool@6.1.0: wanted: {"node":">= 10.0$
[2021-10-07 08:09:09.790] [d-TXYOTNVI0][stderr]WARN engine js-beautify@1.14.0: wanted: {"node":">=10"} (c$
[2021-10-07 08:09:15.977] [d-TXYOTNVI0][stderr]WARN engine update-notifier@5.1.0: wanted: {"node":">=10"}$
[2021-10-07 08:09:16.079] [d-TXYOTNVI0][stderr]WARN engine fsevents@2.3.2: wanted: {"node":"^8.16.0 || ^1$
[2021-10-07 08:09:17.840] [d-TXYOTNVI0][stderr]WARN engine semver@7.3.5: wanted: {"node":">=10"} (current$
[2021-10-07 08:09:17.892] [d-TXYOTNVI0][stderr]WARN engine is-npm@5.0.0: wanted: {"node":">=10"} (current$
[2021-10-07 08:09:17.899] [d-TXYOTNVI0][stderr]WARN engine is-installed-globally@0.4.0: wanted: {"node":"$
[2021-10-07 08:09:17.910] [d-TXYOTNVI0][stderr]WARN engine boxen@5.1.2: wanted: {"node":">=10"} (current:$
[2021-10-07 08:09:17.930] [d-TXYOTNVI0][stderr]WARN engine chalk@4.1.2: wanted: {"node":">=10"} (current:$
[2021-10-07 08:09:17.985] [d-TXYOTNVI0][stderr]WARN engine camelcase@6.2.0: wanted: {"node":">=10"} (curr$
[2021-10-07 08:09:17.990] [d-TXYOTNVI0][stderr]WARN engine wrap-ansi@7.0.0: wanted: {"node":">=10"} (curr$
[2021-10-07 08:09:18.044] [d-TXYOTNVI0][stderr]WARN engine type-fest@0.20.2: wanted: {"node":">=10"} (cur$
[2021-10-07 08:09:19.360] [d-TXYOTNVI0][stderr]WARN engine global-dirs@3.0.0: wanted: {"node":">=10"} (cu$
[2021-10-07 08:09:19.387] [d-TXYOTNVI0][stderr]WARN engine ini@2.0.0: wanted: {"node":">=10"} (current: {$
[2021-10-07 08:09:28.392] [d-TXYOTNVI0][stdout]
[2021-10-07 08:09:28.392] [d-TXYOTNVI0][stdout]> nodemon@2.0.13 postinstall /home/ubuntu/AnimalChat/serve$
[2021-10-07 08:09:28.392] [d-TXYOTNVI0][stdout]> node bin/postinstall || exit 0
[2021-10-07 08:09:28.392] [d-TXYOTNVI0][stdout]
[2021-10-07 08:09:28.843] [d-TXYOTNVI0][stdout]^[[32mLove nodemon? You can now support the project via th$
[2021-10-07 08:09:28.843] [d-TXYOTNVI0][stdout] > ^[[96m^[[1mhttps://opencollective.com/nodemon/donate^[[$
```

오늘 오전에 경훈님이 node 삭제해주셔서, 방금 다시 ec2 인스턴스에 `sudo apt update` - `curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.0/install.sh | bash ` - `export NVM_DIR="$([ -z "${XDG_CONFIG_HOME-}" ] && printf %s "${HOME}/.nvm" || printf %s "${XDG_CONFIG_HOME}/nvm")"
[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm` - `nvm install node ` - `sudo apt install npm`
까지 하다가 마지막 명령어에서 오류를 만났다.

- 설치문제인것 같음..
```jsx
Reading package lists... Done
Building dependency tree
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
npm : Depends: nodejs but it is not going to be installed
Depends: node-abbrev (>= 1.0.4) but it is not going to be installed
Depends: node-ansi (>= 0.3.0-2) but it is not going to be installed
Depends: node-ansi-color-table but it is not going to be installed
Depends: node-archy but it is not going to be installed
Depends: node-block-stream but it is not going to be installed
Depends: node-fstream (>= 0.1.22) but it is not going to be installed
Depends: node-fstream-ignore but it is not going to be installed
Depends: node-github-url-from-git but it is not going to be installed
Depends: node-glob (>= 3.1.21) but it is not going to be installed
Depends: node-graceful-fs (>= 2.0.0) but it is not going to be installed
Depends: node-inherits but it is not going to be installed
Depends: node-ini (>= 1.1.0) but it is not going to be installed
Depends: node-lockfile but it is not going to be installed
Depends: node-lru-cache (>= 2.3.0) but it is not going to be installed
Depends: node-minimatch (>= 0.2.11) but it is not going to be installed
Depends: node-mkdirp (>= 0.3.3) but it is not going to be installed
Depends: node-gyp (>= 0.10.9) but it is not going to be installed
Depends: node-nopt (>= 3.0.1) but it is not going to be installed
Depends: node-npmlog but it is not going to be installed
Depends: node-once but it is not going to be installed
Depends: node-osenv but it is not going to be installed
Depends: node-read but it is not going to be installed
Depends: node-read-package-json (>= 1.1.0) but it is not going to be installed
Depends: node-request (>= 2.25.0) but it is not going to be installed
Depends: node-retry but it is not going to be installed
Depends: node-rimraf (>= 2.2.2) but it is not going to be installed
Depends: node-semver (>= 2.1.0) but it is not going to be installed
Depends: node-sha but it is not going to be installed
Depends: node-slide but it is not going to be installed
Depends: node-tar (>= 0.1.18) but it is not going to be installed
Depends: node-underscore but it is not going to be installed
Depends: node-which but it is not going to be installed
E: Unable to correct problems, you have held broken packages.
```

- 다시 확인된 오류 메세지
```jsx
# Logfile created on 2021-10-07 15:46:26 +0000 by logger.rb/61378
[2021-10-07 15:46:26.062] [d-20C7WZMOC]LifecycleEvent - AfterInstall
[2021-10-07 15:46:26.063] [d-20C7WZMOC]Script - scripts/initialize.sh
[2021-10-07 15:46:28.299] [d-20C7WZMOC][stderr]WARN engine dotenv@10.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3$
[2021-10-07 15:46:28.357] [d-20C7WZMOC][stderr]WARN engine sequelize-cli@6.2.0: wanted: {"node":">=10.0.0"} (current: {"node":"8.10.0$
[2021-10-07 15:46:28.786] [d-20C7WZMOC][stderr]WARN engine sequelize@6.6.5: wanted: {"node":">=10.0.0"} (current: {"node":"8.10.0","n$
[2021-10-07 15:46:35.878] [d-20C7WZMOC][stderr]WARN engine lru-cache@6.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":$
[2021-10-07 15:46:37.545] [d-20C7WZMOC][stderr]WARN engine semver@7.3.5: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.$
[2021-10-07 15:46:38.364] [d-20C7WZMOC][stderr]WARN engine sequelize-pool@6.1.0: wanted: {"node":">= 10.0.0"} (current: {"node":"8.10$
[2021-10-07 15:46:40.129] [d-20C7WZMOC][stderr]WARN engine js-beautify@1.14.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","np$
[2021-10-07 15:46:53.946] [d-20C7WZMOC][stderr]WARN engine update-notifier@5.1.0: wanted: {"node":">=10"} (current: {"node":"8.10.0",$
[2021-10-07 15:46:54.023] [d-20C7WZMOC][stderr]WARN engine fsevents@2.3.2: wanted: {"node":"^8.16.0 || ^10.6.0 || >=11.0.0"} (current$
[2021-10-07 15:46:55.865] [d-20C7WZMOC][stderr]WARN engine semver@7.3.5: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.$
[2021-10-07 15:46:56.596] [d-20C7WZMOC][stderr]WARN engine boxen@5.1.2: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.5$
[2021-10-07 15:46:56.618] [d-20C7WZMOC][stderr]WARN engine is-installed-globally@0.4.0: wanted: {"node":">=10"} (current: {"node":"8.$
[2021-10-07 15:46:56.621] [d-20C7WZMOC][stderr]WARN engine is-npm@5.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.$
[2021-10-07 15:46:56.632] [d-20C7WZMOC][stderr]WARN engine chalk@4.1.2: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.5$
[2021-10-07 15:46:56.675] [d-20C7WZMOC][stderr]WARN engine camelcase@6.2.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":$
[2021-10-07 15:46:56.680] [d-20C7WZMOC][stderr]WARN engine wrap-ansi@7.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":$
[2021-10-07 15:46:57.542] [d-20C7WZMOC][stderr]WARN engine type-fest@0.20.2: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm"$
[2021-10-07 15:47:01.039] [d-20C7WZMOC][stderr]WARN engine global-dirs@3.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm$
[2021-10-07 15:47:01.063] [d-20C7WZMOC][stderr]WARN engine ini@2.0.0: wanted: {"node":">=10"} (current: {"node":"8.10.0","npm":"3.5.2$
[2021-10-07 15:47:15.912] [d-20C7WZMOC][stdout]
[2021-10-07 15:47:15.912] [d-20C7WZMOC][stdout]> nodemon@2.0.13 postinstall /home/ubuntu/AnimalChat/server/node_modules/nodemon
[2021-10-07 15:47:15.912] [d-20C7WZMOC][stdout]> node bin/postinstall || exit 0
[2021-10-07 15:47:15.912] [d-20C7WZMOC][stdout]
[2021-10-07 15:47:16.361] [d-20C7WZMOC][stdout]^[[32mLove nodemon? You can now support the project via the open collective:^[[22m^[[3$
[2021-10-07 15:47:16.361] [d-20C7WZMOC][stdout] > ^[[96m^[[1mhttps://opencollective.com/nodemon/donate^[[0m
[2021-10-07 15:47:16.361] [d-20C7WZMOC][stdout]
[2021-10-07 15:47:16.671] [d-20C7WZMOC][stdout]server@1.0.0 /home/ubuntu/AnimalChat/server
```
## 에러 핸들링 방법
- 중간에 설치 문제인것 같은 에러는 아래의 방법을 참고했다.

```jsx
sudo apt install libssl1.0-dev
sudo apt install nodejs-dev
sudo apt install node-gyp
sudo apt install npm
```

## 에러 핸들링을 위해 참고한 레퍼런스 링크
[예시1](https://askubuntu.com/questions/899756/cant-install-npm-unable-to-correct-problems-you-have-held-broken-packages)

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.