LoginSignup
21
22

More than 5 years have passed since last update.

node.jsとnpmをアップデート

Last updated at Posted at 2017-12-05

node.jsとnpmをアップデートしました。
何を思ったかnpmの方からインストールしたら
???が多かったのでメモ。

update前

terminal
$npm -v
3.10.9
$node -v
v7.1.0

npmをインストール

terminal
$npm install -g npm

エラーが出たので、困った時のsudo

terminal
$sudo npm install -g npm
terminal
$npm -v
3.10.9

変わってない。

nodeからやるべきだったのかーと思って

nodebrewでnode.jsインストール

terminal
$nodebrew install-binary stable 
terminal
$nodebrew use latest

その最新バージョンを使う

terminal
$nodebrew use latest
use v9.2.0
$node -v
v9.2.0

node.jsは無事成功しました。

これでnpmもバージョン変わってるかな、、と

terminal
$npm -v
5.5.1

┌──────────────────────────────────────────────────────────────────┐
│                     npm update check failed                      │
│               Try running with sudo or get access                │
│               to the local update config store via               │
│ sudo chown -R $USER:$(id -gn $USER) /Users/mymac/.config │
└──────────────────────────────────────────────────────────────────┘

バージョンは5.5.1に上がってる!
けどアップデート失敗のお知らせ。

指示通りに

terminal
$sudo chown -R mymac /Users/mymac/.config

これで無事

terminal
$npm -v
5.5.1

解決!

先にnpmからやったのが悪かったんでしょうか?

21
22
1

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
21
22