The problems on installing node-ffi on Mac

I am installing NativeScript on my local Mac and requiring install node-ffi.

I am facing problem as could not recognize libtool -static during installation of node-ffi.

I found out that I had two version of libtool installed, one is for GNU libtool installed via brew install libtool (required by ARDrone3 SDK), and then another one in XCode developer tool. So I had to find way to switch into XCode developer tool.

On my Mac, I had to unlink or remove /usr/bin/libtool and /usr/local/bin/libtool, and then build symlink again as

ln -s /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/libtool /usr/bin/libtool

Then rerun npm install -g ffi, finally, it succeeds.

This is the error screen.

node-ffi error screen

This is the success screen.

node-ffi success screen

This issue takes me 4 hours of findings, googling, uninstall / reinstall libtool, node-gyp and finally found the root cause. I even tried to install it in Cloud9, but found that Cloud9 is a Ubuntu and not Mac, so the installation result do not have Mac built binaries, so cannot just copy the result from Cloud9 to my Mac. Everything must be built well on the Mac.

Author: fyhao

Jebsen & Jessen Comms Singapore INTI University College Bsc (Hon) of Computer Science, Coventry University

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.