개발/Node.js

Mac Node.js 업데이트 (n 모듈)

leebera_ 2022. 5. 9. 01:45

n이라는 node.js 버전 관리 모듈을 이용해서 쉽게 업데이트 가능하다.

실제론 업데이트라기보단 해당 버전을 다운로드하는 것이다.

 

npm에서 n 모듈 설치

sudo npm install -g n

 

업데이트(다운로드)

아래의 예시와 같이 필요한 버전을 설치 가능하다.

sudo n lts
sudo n latest
sudo n 버전

 

버전 변경

버전 관리 모듈이여서 여러 버전을 다운 받고 변경도 가능하다

아래 명령어를 입력하면 다운받은 버전들 목록이 보이고 화살표 위/아래 키로 바꿀 버전으로 커서를 옮기고 엔터 클릭하면 버전이 변경된다.

sudo n

 


 

참고

 

Upgrade Node.js to the latest version on Mac OS

Currently I am using Node.js v0.6.16 on Mac OS X 10.7.4. Now I want to upgrade it to the latest Node.js v0.8.1. But after downloading and installing the latest package file from nodejs.org, I found...

stackoverflow.com

 

n

Interactively Manage All Your Node Versions. Latest version: 8.2.0, last published: 21 days ago. Start using n in your project by running `npm i n`. There are 20 other projects in the npm registry using n.

www.npmjs.com