主に技術的なことを書くブログ

浅めにマークアップ&フロントエンドの技術的なことをメモしていましたが、ざっくばらんに書いています。

急に node.js が動かない系のとき。

急に node.js が動かない系のことがあると思います。

zsh: command not found: node

とか、

env: node: No such file or directory

とかなったとき。

そんなときは、とりあえず、'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: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
    node

なんか node にリンクされてないから 'brew link' してみろと。 'brew link' ってなんやねんと思いつつ。

$ brew link node
Linking /usr/local/Cellar/node/0.10.35_1...
Error: Could not symlink share/man/man1/node.1
Target /usr/local/share/man/man1/node.1
already exists. You may want to remove it:
  rm '/usr/local/share/man/man1/node.1'

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

すでになんかリンクされてるからそれまず消してと。それか 'brew link --overwrite node' で上書きできるよ、こわかったら --dry-run してと。

$ brew link --overwrite node
Linking /usr/local/Cellar/node/0.10.35_1... 5 symlinks created

なんかいけたっぽい。

$ node --version
v0.12.7

いけてた。

よくわからないけど、Homebrew とか npm とか rbenv とか、忘れた頃にやってきて、いつも毎回調べ直す。

なんか自然災害みたい。