본문 바로가기
개발관련

node.js homebrew 설치후 node-v가 안 보일때

by 딸기별땅 2020. 7. 31.

node.js를 홈페이지에서 직접 패키지를 내려받아 설치를 하다보니

Mac OS에서는 계속 권한문제가 발생하더라구요.

게다가 최신 버전은 14.x버전인데 내껀 12.x고.....

node-sass, node-gyp 에러가 계속해서 발생하더군여...

 

동기님의 조언에 따라... 기존 노드 관련된것들을 싹 제거 후 brew install을 진행했습니다.

저는 이미 brew가 모두 셋팅 되어 있긴 하나 친절히 알려 드리겠습니당..복사해서 터미널에 붙여만 넣으세용.

 

[brew 및 cask 설치]

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew cask install

 

자 이제 노드를 설치해야겠죠? 

brew install node

 

설치된 노드의 버전을 확인합니다. 이단계에서 node version이 보인다면 설치 끝.

node -v

 

그런데..저는....노드 버전이 안보입니다...??ㅡ.,ㅡ

wonui-MacBook-Pro:~ won$ node -v
-bash: node: command not found

wonui-MacBook-Pro:~ won$ brew install node -g
Warning: node 14.7.0 is already installed, it's just not linked
You can use `brew link node` to link this version.

커맨드를 못 찾는다 하길래 다시 재설치를 시도해봤으나

이미 설치 되있다면서 노드 링크 명령어를 사용하라는군요

 

wonui-MacBook-Pro:~ won$ brew link node
Linking /usr/local/Cellar/node/14.7.0... 
Error: Could not symlink share/systemtap/tapset/node.stp
Target /usr/local/share/systemtap/tapset/node.stp
already exists. You may want to remove it:
  rm '/usr/local/share/systemtap/tapset/node.stp'

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

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

 

overwrite해도 안되고, dry-run해도 안 되더군요. 위 과정을 몇번 반복했네요 -_-

sudo chmod 776 /usr/local/lib
brew link --overwrite node

 

이 위에 두줄로 권한을 설정해준뒤 다시 link해주었습니다.

Linking /usr/local/Cellar/node/14.7.0... 8 symlinks created
wonui-MacBook-Pro:~ won$ node -v
v14.7.0

와 짝짝짝.. 드디어 버전이 보입니다. -_-)//

댓글