Ubuntu Linux Nodejs 설치 , 업데이트, 실행방법

dev_swan·2022년 1월 26일
0

Linux

목록 보기
3/5
post-thumbnail

nodejs 설치

1.curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.11/install.sh | bash 입력

0.33.11 version을 설치

2.home 디렉토리로 이동

  • cd ~

3.홈디렉토리에 .nvm 폴더 확인

  • ls -al

4-1.nvm --version 입력시
0.33.11 출력되면 완료

4-2.출력 안될 시
source ~/.bashrc 입력 후
nvm --version 입력해보기

nodejs 업데이트

5.nvm install --lts 입력 후 설치

이미 설치를 해두어서 설치 되있다고 알림이 뜨지만 처음 설치하면 버전 업데이트가 완료된다.

6.node -v로 버전 확인되면 완료

node 실행하는 방법

1.node 입력시

" > "화살표가 뜸
컨트롤 c 두번 눌러 나갈 수 있음

2.파일로 실행하기

node 파일명

server2.js 파일안에 console.log("hello world")가 출력된다.

nodejs 설치 및 업데이트, 실행방법 완료.

0개의 댓글