Appcelerator CLI Coreをアップデートしようとしたところ、ネイティブモジュールのビルド中に以下のようなエラーが出て、インストールできなくなりました。
$ appc use 5.0.2
Before you can continue, the latest Appcelerator software update needs to be downloaded.
Finding version 5.0.2 ... ✓
Validating security checksum ✓
Installing ... ✓
Compiling platform native modules ...
└ extract-opts/typechecker ... ✓
└ bunyan/dtrace-provider ... ✓
└ extract-opts/typechecker ... ✓
└ socket.io-client/ws ... ✓
└ appc-ldapjs/dtrace-provider ... ✓
└ bunyan/dtrace-provider ... ✓
└ appc-ldapjs/dtrace-provider ... ✓
└ ws/bufferutil ... ld: library not found for -lgcc_s.10.5
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [Release/bufferutil.node] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack at ChildProcess.onExit (/Users/hoge/.anyenv/envs/ndenv/versions/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack at ChildProcess.emit (events.js:98:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:820:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "node" "/Users/hoge/.anyenv/envs/ndenv/versions/v0.10.40/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/hoge/.appcelerator/install/5.0.2/package/node_modules/arrow/node_modules/appc-pubsub/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.40
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm ERR! Darwin 14.5.0
npm ERR! argv "node" "/Users/hoge/.anyenv/envs/ndenv/versions/v0.10.40/bin/npm" "install" "bufferutil@1.1.0" "--production"
npm ERR! node v0.10.40
npm ERR! npm v3.3.8
npm ERR! code ELIFECYCLE
npm ERR! bufferutil@1.1.0 install: `node-gyp rebuild`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the bufferutil@1.1.0 install script 'node-gyp rebuild'.
npm ERR! This is most likely a problem with the bufferutil package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls bufferutil
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/hoge/.appcelerator/install/5.0.2/package/node_modules/arrow/node_modules/appc-pubsub/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/npm-debug.log
発生した環境
環境 | バージョン |
---|---|
OS | Mac OS X 10.10.5 |
Xcode | 6.4 |
Command Line Tools | 7.0 |
Node | v0.10.40 |
Appcelerator CLI (npm) | 4.2.0 |
Node.jsのバージョン管理には ndenv を使っています。
実はこの環境で、上記のエラーになっているNode.js v0.10.40とAppcelerator CLI Core v5.0.2の組み合わせで動いていました。
今回、Node.jsのバージョンをv0.12.7に切り替えてみたのですが、うまく動かなくなってしまったため、v0.10.40へ戻したところ、このエラーが発生するようになってしまいました。
直接の原因かどうかは不明ですが、ビルドできなくなる前後で思い当たるのは、Command Line Toolsの7.0が入ったことでしょうか。Xcodeは、まだ6.4のままの環境ですが、Commad Line Toolsの方だけ、うっかりソフトウェア・アップデートであげてしまったのですが、Node.jsでも似たようなIssueがあがっていた ようなので、もしかしたら何か関係があるかもしれません。
対処方法
bufferutilがエラーになる原因はnode-gypにあるようですが、 bufferutilのIssueに書かれていた方法 で、ひとまずビルドが通るようになりました。
$ cd /usr/local/lib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.5.dylib
$ sudo ln -s ../../lib/libSystem.B.dylib libgcc_s.10.4.dylib