LoginSignup
51
26

Node.js を完全にアンインストールする

Last updated at Posted at 2020-03-08

過去に Mac nodebrew で Node.js をインストールする手順 の記事を書きました。

現在の私の環境ではnodebrewは削除して、Node.jsnodenvで管理し、nodenvはanyenvで管理してます。

追記: 記事書きました。

追記: さらに記事書きました。

グローバルパッケージの確認

削除前に再インストールしたいパッケージがあれば確認しておく。

$ npm ls -g

アンインストール手順

$ brew uninstall nodebrew
$ curl -o uninstall-node.sh https://gist.githubusercontent.com/nicerobot/2697848/raw/uninstall-node.sh
$ chmod u+x uninstall-node.sh 
$ ./uninstall-node.sh 
  空Enter でアンインストール処理を進める
$ rm uninstall-node.sh

この辺のディレクトリもあったら消す

$ sudo rm -rf /usr/local/include/node
$ sudo rm -rf /usr/local/lib/dtrace
$ rm -rf ~/.node-gyp
$ rm -rf ~/.npm
$ rm -rf ~/.sourcemint 
$ which node
/usr/local/lib/node

$ rm -rf /usr/local/lib/node
# 診断コマンドを実行
$ brew doctor

# 必要に応じて...
$ brew prune
$ brew cleanup

anyenv のインストール方法

別記事にまとめています。
Mac を買ったら必ずやっておきたい初期設定

51
26
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
51
26