開発環境をアップデートした
こまめにすればいいんだけど、時間がとれなかったり、トラブったりすると余計時間かかってしまうので、時間あるときにやるしかなかったり。
brew、node、npmをアップグレードしたいな、と。 だいたいやり方をいつも忘れるのでメモ。
nodeの場所
$ ls -la /usr/local/bin/node
lrwxr-xr-x 1 admin admin 29 12 25 2015 /usr/local/bin/node -> ../Cellar/node/5.3.0/bin/node
homebrewでインストールしていた
//Node.jsのバージョンを確認
$ node -v
v5.3.0
//npmバージョン確認
$ npm -v
3.3.12
かなり古い
npmは homebrewでnodeをインストールした時に一緒に入るので、個別にインストールはしない
とりあえずbrewを更新してなかったので
$brew update
でアップデート
$brew doctor
でデッドシンボリックリンクあるよってでるので
$ brew prune
で削除
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install cairo fontconfig freetype libpng pixman
依存関係が消えてるからインストールしろとのこと。言われたとおりにする
$ brew install cairo fontconfig freetype libpng pixman
けっこう時間かかります
もう一度 brew doctor
$ brew doctor
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!
Warning: Some installed formula are missing dependencies.
You should `brew install` the missing dependencies:
brew install openssl@1.1
Run `brew missing` for more details.
あ、openssl・・・
$ brew install openssl@1.1
これでインストールはされたけど、パスが /usr/bin/opensslにむいたままで、古い方をみている状態
$ which openssl
/usr/bin/openssl
$ openssl version
OpenSSL 0.9.8zg 14 July 2015
$ brew link openssl –force
ってやってもなおりません
パスを読み込ませる設定をしておきます
$vi .bashrc
export PATH=/usr/local/Cellar/openssl@1.1/1.1.0c/bin:$PATH
を追加
$ source ~/.bash_profile
$ which openssl
/usr/local/Cellar/openssl@1.1/1.1.0c/bin/openssl
$ openssl version
OpenSSL 1.1.0c 10 Nov 2016
なおったようです
アップグレードします
$ brew upgrade
ものすごい時間かかる
$ brew doctor
でエラーでなかったのでとりあえずOK
バージョンアップされてるか調べる
$ node -v
v7.4.0
$ npm -v
4.0.5
両方バージョンアップしました。
npmのパッケージはローカルにインストールしているので、
各開発ディレクトリで
npm install パッケージ
で全部いれなおしました。