LoginSignup
1
0

More than 5 years have passed since last update.

Macでlibtool: unrecognized option `-static'といエラーが出たときの対応

Last updated at Posted at 2018-03-31

現象

npm installでモジュール入れようとすると、、ビルドでこける(以下、抜粋)。

ちなみに、npm install -g remixdでこけた。

> node-gyp rebuild

  SOLINK_MODULE(target) Release/copied_files.node
  CC(target) Release/obj.target/scrypt_wrapper/src/util/memlimit.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/keyderivation.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/pickparams.o
  CC(target) Release/obj.target/scrypt_wrapper/src/scryptwrapper/hash.o
  LIBTOOL-STATIC Release/scrypt_wrapper.a
libtool: unrecognized option `-static'
libtool: Try `libtool --help' for more information.
make: *** [Release/scrypt_wrapper.a] Error 1
gyp ERR! build error

node-gypのエラーはpython2.7を入れたら解決!的な記事もあったが、私の環境ではpythonは2.7。。。

原因

原因は私の環境に強く依存するものでした。。。
私はMAMPを使っており、MySQLをPATHを通すため、.bash_profileで、

export PATH=/Applications/MAMP/Library/bin:$PATH

として、MAMPが/usr/binよりも優先されるようにしていたのですが、/Applications/MAMP/Library/bin以下にもlibtoolがり、さらにそのlibtoolが/usr/bin/libtool(標準)とは仕様が違うようなのです。

対応

方法は2つの方向

  • .bash_profileのPATHを変更する(MAMP優先でなくする)
  • PATH=/Applications/MAMP/Library/bin/libtoolをリネームする

MAMPのlibtoolを利用することは無いのでとりあえず後者のリネームで対応しました。何か不具合があればまた考えます。

私的環境依存ですが、いちおうメモ。

追記

node-gyp rebuildがらみのエラーもこれ。
npm install truffle-hdwallet-provider
でも同じ原因がコケました。。。

1
0
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
1
0