LoginSignup
3
2

More than 5 years have passed since last update.

titanium-cliのインストールでつまづいたのでメモ

Posted at

どこをみてもHomebrewを入れて、

$ brew install node
$ sudo npm install -g titanium
$ sudo npm install -g alloy

でtitanium-cliは入るよという感じなのだが、どうも昔入れたHomebrewの入れ方が悪かったのかpathの通し方が悪かったのかわからないがtiatniumのインストールでエラーが出るので、HomebrewでなくNodebrewなるもので入れなおしてみたがこれもうまくいかない。

node.jsの管理をhomebrewからnodebrewに変えて、npmをインストール

環境がぐちゃぐちゃになってしまったのでHomebrewの全削除を試みる。

Homebrewのアンインストールと再インストール

このあとHomebrewを入れなおすも、、

$ brew install node

==> Downloading http://nodejs.org/dist/v0.10.20/node-v0.10.20.tar.gz
Already downloaded: /Library/Caches/Homebrew/node-0.10.20.tar.gz
==> Patching
patching file tools/gyp/pylib/gyp/xcode_emulation.py
==> ./configure --prefix=/usr/local/Cellar/node/0.10.20
==> make install
==> Caveats
Probably you should amend your PATH to include npm-installed binaries:
    /usr/local/share/npm/bin
Warning: Could not link node. Unlinking...
Error: The `brew link` step did not complete successfully
The formula built, but is not symlinked into /usr/local
You can try again using `brew link node'

Possible conflicting files are:
/usr/local/bin/node
/usr/local/share/man/man1/node.1
Error: undefined method `unlink' for nil:NilClass
Please report this bug:
    https://github.com/mxcl/homebrew/wiki/troubleshooting
/usr/local/Library/Homebrew/formula_installer.rb:499:in `record_cxx_stdlib'
/usr/local/Library/Homebrew/formula_installer.rb:351:in `finish'
/usr/local/Library/Homebrew/cmd/install.rb:83:in `install_formula'
/usr/local/Library/Homebrew/cmd/install.rb:24:in `install'
/usr/local/Library/Homebrew/cmd/install.rb:22:in `each'
/usr/local/Library/Homebrew/cmd/install.rb:22:in `install'
/usr/local/Library/brew.rb:95:in `send'
/usr/local/Library/brew.rb:95

と、なってしまいNode.jsすらインストールできなくなる、、、
なんやねん、、、検索しても何が原因かわからん、、
Homebrewのアンインストール時に余計なものまで消したのかと思い、Xcodeのコマンドラインツールを入れなおしたり、gccを入れたりしたが駄目、、、
手順を変えてnvmを先に入れてかnode.js入れたらすんなり終わりました。

$ git clone git://github.com/creationix/nvm.git ~/.nvm
$ source ~/.nvm/nvm.sh

$ nvm install list
$ nvm install v0.10.13
$ node -v
v0.10.13
$ npm -v
1.3.2

$ sudo npm install -g titanium
$ titanium -v
3.1.2

よくよく考えればnvmがnode.jsのバージョン管理ツールなんだからはじめからこの手順でやればよかった、、
どこみてもbrew install node でやってるけどどっちが正道なのだろう。

3
2
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
3
2