터미널에서

1. nvm 버전 확인 ( nvm : 노드 버전 관리 )

nvm -v

2. 없으면 nvm 설치

# installs nvm (Node Version Manager)
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.0/install.sh | bash

3.  터미널 종료하고 다시 실행

4. nvm 버전 확인

nvm -v


0.40.0

5. 노드 설치  & 버전 확인

# lts 최신 버전 설치하려면
nvm install --lts

# 특정 버전 설치 (예를 들어 20)
nvm install 20

 

#노드 버전 확인
node -v

https://nodejs.org/en/download/package-manager

 

Node.js — Download Node.js®

Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.

nodejs.org

 

https://velog.io/@mayinjanuary/NVM-이란-노드Node.js-버전-관리하는-법

macOS Big Sur 또는 macOS Catalina 에서 추가 작업이 필요하다.

전체 설치 과정은 [DB]몽고DB 설치 - macOS Big Sur 참조

# 테스트 환경 #
- macOS Big Sur 버전 11.x.x
- mongodb community 버전 4.2.x
- Homebrew 버전 3.x.x

 

오류 원인 : 데이터를 저장하는 폴더를 다음과 같이 만들 경우, 현재 macOS Big Sur에서에서 mongo적용되지 않는다.

$ sudo mkdir -p /data/db
mkdir: /data/db: Read-only file system

위 메시지 무시하고 설치 진행하면 다음과 같은 오류 메시지를 만난다.

오류 메시지 : 

[initandlisten] exception in initAndListen: NonExistentPath: Data directory /data/db not found. Create the missing directory or specify another path using (1) the --dbpath command line option, or (2) by adding the 'storage.dbPath' option in the configuration file., terminating

 

해결 : dbpath 설정 - 일반적으로 /data/db 경로이지만, /data/db 경로는 macOS Catalina부터 현재 Big Sur 버전에서 적용되지 않으므로, 다음과 같은 다른 경로를 설정한다.

mongod --dbpath /usr/local/var/mongodb/

 

+ Recent posts