우분투에서 NodeSource를 사용하여 nodejs(Node.js)를 설치하고 관리하는 방법
NodeSource는 Node.js의 공식 바이너리를 제공하는 저장소로 다양한 버전의 Node.js를 쉽게 설치할 수 있게 도와줍니다.
1. NodeSource 저장소 추가
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo bash -
2024-11-26 13:47:43 - Repository configured successfully.
2024-11-26 13:47:43 - To install Node.js, run: apt-get install nodejs -y
2024-11-26 13:47:43 - You can use N|solid Runtime as a node.js alternative
2024-11-26 13:47:43 - To install N|solid Runtime, run: apt-get install nsolid -y
- Node.js 18.x : https://deb.nodesource.com/setup_18.x
curl -fsSL https://deb.nodesource.com/setup_18.x | sudo bash -
- Node.js 16.x : https://deb.nodesource.com/setup_16.x
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo bash -
- Node.js 14.x : https://deb.nodesource.com/setup_14.x
curl -fsSL https://deb.nodesource.com/setup_14.x | sudo bash -
2. Node.js 설치
최신 Node.js 및 npm(Node.js 패키지 관리자)을 설치합니다.
sudo apt-get install -y nodejs
3. 설치 확인
Node.js와 npm의 버전을 확인합니다.
node -v
npm -v
$ node -v
v20.18.1
$ npm -v
10.8.2
npm을 통해 패키지 관리
Node.js와 npm이 설치된 후에는 npm을 사용하여 패키지를 관리할 수 있습니다.
- express 패키지 설치
npm install express
curl -fssl https://deb.nodesource.com/setup_16.x | Sudo Bash-
'리눅스' 카테고리의 다른 글
[draft] 리눅스 플랫폼, 아키텍처, 시스템의 비트를 확인하는 방법 (0) | 2025.09.26 |
---|---|
[draft] macOS에 Session Manager 플러그인 설치 및 제거 (0) | 2025.09.26 |
[draft] AWS CLI 설치하는 방법(Linux ARM) (0) | 2025.09.26 |
[draft] AWS CLI 설치하는 방법 (0) | 2025.09.26 |
[draft] 시스템 시간 확인과 시간 동기화하는 방법 (0) | 2025.09.26 |