Claude MCP 에러 (asdf 0.17.0 사용자)
Homebrew 업데이트를 주기적으로 적용하면서, asdf의 버전도 자동으로 0.17.0으로 업그레이드되었다. 그런데 그 이후, Claude Desktop을 실행할 때 내부적으로 사용하는 MCP 서버가 실행되지 않는 현상이 발생했다.
여러 문제점을 찾던 도중에 아래 github의 issue를 보았다.
나랑 비슷한 문제를 겪고있는듯 했다.
대충 내용은 이랬음 (GPT로 요약해달라고 했음)
asdf를 Homebrew로 설치한 후 Node.js 플러그인을 통해 LTS 버전(예: 22.15.1)을 설치했을 때, npm install -g yarn과 같은 글로벌 패키지가. asdf 내부가 아니라 Homebrew 경로(/opt/homebrew)에 설치되는 문제가 발생함.
영향받는 버전
- asdf 0.17.0 (Homebrew 설치)
- macOS (arm64) 환경, 특히 Apple Silicon 기반 시스템에서 자주 발생
재현 절차
깨끗한 시스템에서 Homebrew로 asdf 설치
- asdf plugin add nodejs → asdf install nodejs 22.15.1
- npm install -g yarn 실행
- yarn 실행 시 ~/.asdf/shims/yarn에 생기지 않고, /opt/homebrew/bin/yarn에 설치됨
- npm config ls 확인 시 prefix가 ~/.asdf가 아닌 /opt/homebrew로 설정되어 있음
원인 분석
- asdf를 통해 설치된 npm이 내부적으로 Homebrew 환경에 설정된 전역 prefix (/opt/homebrew)를 그대로 따라감
- 그 결과로 .asdf/shims 경로에는 yarn 실행파일이 생기지 않고, 전역 패키지가 모두 Homebrew 경로로 빠짐
- 이는 asdf로 Node.js 버전을 분리해서 사용할 때 글로벌 패키지가 한 곳에 섞이는 부작용을 유발
그래서 해결하려고 asdf 패키지를 downgrade 하려고 했는데 방법이 따로 없었음
예를 들어 버전마다 asdf@0.16.7 이런 게 등록되어있지 않아서 해결이 안 됨.
그러던 도중 github issue에서 우회하는 방법으로 다운그레이드를 할 수 있는 방법을 찾음.
Homebrew의 이전 포뮬러 커밋을 직접 다운로드하여 수동으로 설치
해당 커밋아이디는 0.16.7 버전 커밋 아이디이다.
curl -L https://raw.githubusercontent.com/Homebrew/homebrew-core/1d665566d3b4d3a493667c45c8fdc68add50cd05/Formula/a/asdf.rb -o asdf.rb
brew unlink asdf
brew install --formula ./asdf.rb
brew pin asdf # optional, if you want to avoid upgrading again
이렇게 하고 claude desktop 실행했더니 mcp 오류 없이 잘 된다..
참고로 brew pin asdf로 고정해둔 상태는 이후 brew unpin asdf로 해제 가능하므로, 추후 문제 해결 시 다시 업그레이드해보면 된다.
https://github.com/asdf-vm/asdf-nodejs/issues/423
bug: `npm install -g yarn` install location not going to ~/.asdf · Issue #423 · asdf-vm/asdf-nodejs
Describe the Bug In short: When asdf is installed with homebrew, installing nodejs packages globally will send them to /opt/homebrew instead of ~/.asdf I don't recall seeing this issue under 0.16.0...
github.com
참고
https://github.com/asdf-vm/asdf/issues/1892
bug: asdf cannot be downgraded via homebrew · Issue #1892 · asdf-vm/asdf
Describe the Bug asdf 0.16.0 has a lot of breaking changes which cause other tools in the ecosystem to break. For example RubyMine needs to be manually configured in a painful way. As a result it w...
github.com