mooz/node-icu-charset-detector

can't npm install with node v4.1.1

azhang opened this issue · 8 comments

> node-icu-charset-detector@0.1.3 install /Users/aaron/src/bn/bottlenose/node_modules/node-icu-charset-detector
> node-gyp rebuild

  CXX(target) Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o
../node-icu-charset-detector.cpp:7:10: fatal error: 'unicode/ucsdet.h' file not
      found
#include <unicode/ucsdet.h>
         ^
1 error generated.
make: *** [Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o] Error 1
gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:270:23)
gyp ERR! stack     at emitTwo (events.js:87:13)
gyp ERR! stack     at ChildProcess.emit (events.js:172:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Darwin 14.5.0
gyp ERR! command "/usr/local/bin/iojs" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/aaron/src/bn/bottlenose/node_modules/node-icu-charset-detector
gyp ERR! node -v v4.1.1
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN optional dep failed, continuing node-icu-charset-detector@0.1.3

Same here.

tsde commented

Hi,

Try to install the libicu-dev package. This should fix the problem.

On Debian-like

sudo apt-get install libicu-dev

On Red-Hat like

sudo yum install libicu-devel

How to install libicu-dev in OSX (Mac) ?
I can't search in brew.
Can it be installed from source?

tsde commented

Sorry, I'm not used to OSX but if you don't find the package with brew, you could try to compile from sources: http://site.icu-project.org/download/56

brew install icu4c

That installs the lib and correct headers. The package does not seem to pick it up though...

Dur, just follow the instructions here: https://github.com/mooz/node-icu-charset-detector#installing-icu

brew install icu4c
brew link icu4c --force

Yeah. It works. Thanks.

brew link icu4c --force

Worked. Thanks @ismell