node.js 설치

Sangyeong Je·2022년 10월 17일
0

서버설정

목록 보기
4/8

1. nvm(Node Version Manager) 설치

  1. curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
    cURLnvm을 설치한다.

  2. export NVM_DIR="$HOME/.nvm"
    nvm을 디폴트로 설정한다.

  3. 터미널을 재시작한다.

  4. nvm --version
    설치되었는지 확인을 해본다.

2. node.js 설치

  1. nvm ls-remote
    설치가능한 버전을 확인한다.

  2. nvm install [버전]
    설치하고 싶은 버전을 넣고 인스톨한다.

  1. node -v
    설치되었는지 확인을 해본다.

  2. nvm alias default [버전]
    nvm의 디폴트 버전을 변경한다.

3. pm2 설치

npm install pm2 -g

4. nvm 명령어

# 현재 사용중인 버전 확인하기
nvm current

# 설치된 node.js 목록 확인하기
nvm ls

# node.js 설치 경로 확인하기
which node

# 필요없는 node 버전 삭제하기
nvm uninstall 8.9.4```

5. 소켓설치

npm -g install request forever supervisor express express-generator socket.io

0개의 댓글