FrontEnd :-)

mac OS에서 node 이전 버전으로 다운그레이드 본문

Terminal

mac OS에서 node 이전 버전으로 다운그레이드

code10 2023. 2. 12. 15:10

[참고] 1. mac OS에서 node 이전 버전으로 다운그레이드 https://mesonia.tistory.com/151

           2. brew install npm 시 설치는 되었으나 link가되지 않을때 https://giantdwarf.tistory.com/21

 

1. 현재 노드 버전 보기

$ node -v

2. 사용 가능한 노드 버전 확인

$ brew search node

3. 현재 버전과의 연결 해제

$ brew unlink node

4. Node 16버전 설치 예시

$ brew install node@16

5. 설치된 버전을 연결

$ brew link node@16

완료.

 

Error 설치는 됐는데 link 연결이 안 됐다.

 

% node -v
zsh: command not found: node

 

필요에 따라 ~/.zshrc에 추가하라는 내용을 넣었으나 안됐다. vim ~/.zshrc => i (insert) => 내용 입력 => esc => :wq 엔터!

echo 'export PATH="/opt/homebrew/opt/node@16/bin:$PATH"'

 

오류 내용

% brew link node@16
Linking /usr/local/Cellar/node@16/16.19.0_1... 
Error: Could not symlink include/node/common.gypi
Target /usr/local/include/node/common.gypi
already exists. You may want to remove it:
  rm '/usr/local/include/node/common.gypi'

To force the link and overwrite all conflicting files:
  brew link --overwrite node@16

To list all files that would be deleted:
  brew link --overwrite --dry-run node@16

 

link 안 될 때 해결 방법을 찾았고, 아래 순서로 입력하니 해결됨.

% sudo chown -R $(whoami) $(brew --prefix)/*
Password: (컴퓨터 사용자 패스워드)

% brew link --overwrite node@16           

% node -v
v16.19.0

 

노드 18 버전에서 16 버전으로 설치 완료'-'!

Comments