Node JS 버전을 쉽게 관리할 수 있다고? NVM(Node Version Manager)

Nevgiveup·2024년 11월 18일
0

NodeJS

목록 보기
1/1
post-thumbnail

데스크탑에서 개발하던 프로젝트를 노트북으로 옮겨서 갈때 github에 push하고 그걸 다시 노트북에서 받는 식으로 했는데 백엔드 서버가 열리지 않았다.

npm warn deprecated inflight@1.0.6: This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.
npm warn deprecated npmlog@5.0.1: This package is no longer supported.
npm warn deprecated rimraf@3.0.2: Rimraf versions prior to v4 are no longer supported
npm warn deprecated glob@7.2.3: Glob versions prior to v9 are no longer supported
npm warn deprecated are-we-there-yet@2.0.0: This package is no longer supported.
npm warn deprecated gauge@3.0.2: This package is no longer supported.
npm error code 3221225477
npm error path C:\Users\aodao\OneDrive\바탕 화면\authPage-master\node_modules\bcrypt
npm error command failed
npm error command C:\WINDOWS\system32\cmd.exe /d /s /c node-pre-gyp install --fallback-to-build
npm error A complete log of this run can be found in: C:\Users\aodao\AppData\Local\npm-cache\_logs\2024-11-13T11_04_48_997Z-debug-0.log

npm run nodemon app.js 를 해도 그냥 그대로 출력이 됨.

버전이 맞지 않는것 같아서 확인했더니 노트북은 옛날에 하던게 있어서 14. 버전이었다.

그래서 노트북에 있는 node를 최신버전 22. 버전으로 업데이트를 했음. 근데도 계속 되지않았음. 그래서 데스크탑의 node 버전을 확인했더니 20.16.0이었다. 그래서 찾아본 결과 버전을 쉽게 바꿀수 있는 nvm이라는 버전 관리 도구를 찾았다.
다운로드 링크 : https://github.com/coreybutler/nvm-windows/releases

nvm-setup.zip 을 다운받고

window powerShell 관리자 권한으로 열고 nvm을 사용할 수 있다.

명령어 정리


nvm list available ( 사용가능한 node버전 목록 보기 )

 > nvm list available

|   CURRENT    |     LTS      |  OLD STABLE  | OLD UNSTABLE |
|--------------|--------------|--------------|--------------|
|    23.2.0    |   22.11.0    |   0.12.18    |   0.11.16    |
|    23.1.0    |   20.18.0    |   0.12.17    |   0.11.15    |
|    23.0.0    |   20.17.0    |   0.12.16    |   0.11.14    |
|   22.10.0    |   20.16.0    |   0.12.15    |   0.11.13    |
|    22.9.0    |   20.15.1    |   0.12.14    |   0.11.12    |
|    22.8.0    |   20.15.0    |   0.12.13    |   0.11.11    |
|    22.7.0    |   20.14.0    |   0.12.12    |   0.11.10    |
|    22.6.0    |   20.13.1    |   0.12.11    |    0.11.9    |
|    22.5.1    |   20.13.0    |   0.12.10    |    0.11.8    |
|    22.5.0    |   20.12.2    |    0.12.9    |    0.11.7    |
|    22.4.1    |   20.12.1    |    0.12.8    |    0.11.6    |
|    22.4.0    |   20.12.0    |    0.12.7    |    0.11.5    |
|    22.3.0    |   20.11.1    |    0.12.6    |    0.11.4    |
|    22.2.0    |   20.11.0    |    0.12.5    |    0.11.3    |
|    22.1.0    |   20.10.0    |    0.12.4    |    0.11.2    |
|    22.0.0    |    20.9.0    |    0.12.3    |    0.11.1    |
|    21.7.3    |   18.20.5    |    0.12.2    |    0.11.0    |
|    21.7.2    |   18.20.4    |    0.12.1    |    0.9.12    |
|    21.7.1    |   18.20.3    |    0.12.0    |    0.9.11    |
|    21.7.0    |   18.20.2    |   0.10.48    |    0.9.10    |


nvm install < version > ( < version > 다운받기 )

LTS버전이 안정적임

> nvm install 22.11.0
Downloading node.js version 22.11.0 (64-bit)...
Extracting node and npm...
Complete
npm v10.9.0 installed successfully.

Installation complete. If you want to use this version, type

nvm use 22.11.0


nvm ls ( 설치된 노드의 버전 목록 확인하기 )

> nvm ls

    22.11.0
  * 20.16.0 (Currently using 64-bit executable)


nvm use < version > ( < version > 사용하기 )

> nvm use 22.11.0
Now using node v22.11.0 (64-bit)


nvm current (현재 버전 확인하기)

> nvm current
v20.16.0

profile
while( true ) { study(); }

0개의 댓글