mooz/node-icu-charset-detector

Can't install using node 5

musicalshore opened this issue · 7 comments

npm install --save node-icu-charset-detector

node-icu-charset-detector@0.0.7 install /Users/michaelrusso/Development/sp-nodered-workflow/node_modules/node-red/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:66:15: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
New(const v8::Arguments& args) {
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../node-icu-charset-detector.cpp:81:19: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
GetName(const v8::Arguments& args) {
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../node-icu-charset-detector.cpp:93:23: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
GetLanguage(const v8::Arguments& args) {
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../node-icu-charset-detector.cpp:105:25: error: no type named 'Arguments' in namespace 'v8'; did you mean 'v8::internal::Arguments'?
GetConfidence(const v8::Arguments& args) {
^~~~~~~~~~~~~
v8::internal::Arguments
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: 'v8::internal::Arguments' declared here
class Arguments;
^
../node-icu-charset-detector.cpp:19:25: error: calling a protected constructor of class 'v8::HandleScope'
v8::HandleScope scope;
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:889:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../node-icu-charset-detector.cpp:22:41: error: cannot initialize a parameter of type 'v8::Isolate ' with an lvalue of type
'v8::Handlev8::Value (const v8::internal::Arguments &)'
= v8::FunctionTemplate::New(CharsetMatch::New);
^~~~~~~~~~~~~~~~~
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:4349:16: note: passing argument to parameter 'isolate' here
Isolate
isolate, FunctionCallback callback = 0,
^
../node-icu-charset-detector.cpp:27:67: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void ()(const
FunctionCallbackInfov8::Value &)') with an lvalue of type 'v8::Handlev8::Value (const v8::internal::Arguments &)': type
mismatch at 1st parameter ('const FunctionCallbackInfov8::Value &' vs 'const v8::internal::Arguments &')
NODE_SET_PROTOTYPE_METHOD(constructorTemplate, "getName", CharsetMatch::GetName);
^~~~~~~~~~~~~~~~~~~~~
/Users/michaelrusso/.node-gyp/5.0.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../node-icu-charset-detector.cpp:28:71: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void (
)(const
FunctionCallbackInfov8::Value &)') with an lvalue of type 'v8::Handlev8::Value (const v8::internal::Arguments &)': type
mismatch at 1st parameter ('const FunctionCallbackInfov8::Value &' vs 'const v8::internal::Arguments &')
NODE_SET_PROTOTYPE_METHOD(constructorTemplate, "getLanguage", CharsetMatch::GetLanguage);
^~~~~~~~~~~~~~~~~~~~~~~~~
/Users/michaelrusso/.node-gyp/5.0.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../node-icu-charset-detector.cpp:29:73: error: cannot initialize a parameter of type 'v8::FunctionCallback' (aka 'void ()(const
FunctionCallbackInfov8::Value &)') with an lvalue of type 'v8::Handlev8::Value (const v8::internal::Arguments &)': type
mismatch at 1st parameter ('const FunctionCallbackInfov8::Value &' vs 'const v8::internal::Arguments &')
NODE_SET_PROTOTYPE_METHOD(constructorTemplate, "getConfidence", CharsetMatch::GetConfidence);
^~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/michaelrusso/.node-gyp/5.0.0/include/node/node.h:254:60: note: passing argument to parameter 'callback' here
v8::FunctionCallback callback) {
^
../node-icu-charset-detector.cpp:32:33: error: no member named 'NewSymbol' in 'v8::String'
target->Set(v8::String::NewSymbol("CharsetMatch"), constructorTemplate->GetFunction());
~~~~~~~~~~~~^
../node-icu-charset-detector.cpp:67:17: error: member access into incomplete type 'const v8::internal::Arguments'
if (args.Length() < 1 || !node::Buffer::HasInstance(args[0]))
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../node-icu-charset-detector.cpp:68:20: error: no member named 'New' in 'v8::String'
return EXCEPTION(TypeError, "Expected Buffer for the argument");
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node-icu-charset-detector.cpp:11:52: note: expanded from macro 'EXCEPTION'
ThrowException(v8::Exception::type(v8::String::New(message)))
~~~~~~~~~~~~^
../node-icu-charset-detector.cpp:71:42: error: type 'const v8::internal::Arguments' does not provide a subscript operator
CharsetMatch::FromBuffer(args[0]->ToObject())->Wrap(args.This()); // under GC
~~~~^~
../node-icu-charset-detector.cpp:71:69: error: member access into incomplete type 'const v8::internal::Arguments'
CharsetMatch::FromBuffer(args[0]->ToObject())->Wrap(args.This()); // under GC
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../node-icu-charset-detector.cpp:73:20: error: no member named 'New' in 'v8::String'
return EXCEPTION(Error, errorMessage);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../node-icu-charset-detector.cpp:11:52: note: expanded from macro 'EXCEPTION'
ThrowException(v8::Exception::type(v8::String::New(message)))
~~~~~~~~~~~~^
../node-icu-charset-detector.cpp:76:20: error: member access into incomplete type 'const v8::internal::Arguments'
return args.This();
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../node-icu-charset-detector.cpp:82:25: error: calling a protected constructor of class 'v8::HandleScope'
v8::HandleScope scope;
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:889:13: note: declared protected here
V8_INLINE HandleScope() {}
^
../node-icu-charset-detector.cpp:83:73: error: member access into incomplete type 'const v8::internal::Arguments'
CharsetMatch
self = node::ObjectWrap::Unwrap(args.This());
^
/Users/michaelrusso/.node-gyp/5.0.0/include/node/v8.h:139:7: note: forward declaration of 'v8::internal::Arguments'
class Arguments;
^
../node-icu-charset-detector.cpp:85:26: error: no member named 'Close' in 'v8::HandleScope'
return scope.Close(v8::Null());
~~~~~ ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors 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 (/Users/michaelrusso/.nvm/versions/node/v5.0.0/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 "/Users/michaelrusso/.nvm/versions/node/v5.0.0/bin/node" "/Users/michaelrusso/.nvm/versions/node/v5.0.0/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/michaelrusso/Development/sp-nodered-workflow/node_modules/node-red/node_modules/node-icu-charset-detector
gyp ERR! node -v v5.0.0
gyp ERR! node-gyp -v v3.0.3
gyp ERR! not ok
npm WARN install:node-icu-charset-detector node-icu-charset-detector@0.0.7 install: node-gyp rebuild
npm WARN install:node-icu-charset-detector Exit status 1

node-icu-charset-detector@0.1.4 install /Users/michaelrusso/Development/sp-nodered-workflow/node_modules/node-icu-charset-detector
node-gyp rebuild

CXX(target) Release/obj.target/node-icu-charset-detector/node-icu-charset-detector.o
SOLINK_MODULE(target) Release/node-icu-charset-detector.node

Using --prefix=/usr/local/bin//..

I am also having an issue building on Windows 7 x64 with nodejs 5.6.0

Building the projects in this solution one at a time. To enable parallel build, please add the "/m" s
witch.
  node-icu-charset-detector.cpp
..\node-icu-charset-detector.cpp(7): fatal error C1083: Cannot open include file: 'unicode/ucsdet.h'
: No such file or directory [C:\api\node_modules\node-icu-charset-detector\build\node-icu-c
harset-detector.vcxproj]
gyp ERR! build error
gyp ERR! stack Error: `C:\Program Files (x86)\MSBuild\12.0\bin\msbuild.exe` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node
-gyp\lib\build.js:276:23)
gyp ERR! stack     at emitTwo (events.js:100:13)
gyp ERR! stack     at ChildProcess.emit (events.js:185:7)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:200:12)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\
\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
gyp ERR! cwd C:\api\node_modules\node-icu-charset-detector
gyp ERR! node -v v5.6.0
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
npm WARN install:node-icu-charset-detector@0.1.4 node-icu-charset-detector@0.1.4 install: `node-gyp r
ebuild`
npm WARN install:node-icu-charset-detector@0.1.4 Exit status 1

Cannot repro on 64-bit Ubuntu 14.04. npm install node-icu-charset-detector works as expected. I'm using Node.js v5.9.1 and npm v3.7.3 (installed via nvm).

I'm having the same issue as @mavrick with Node v5.9.1 and npm v3.7.3 on Win10.

..\node-icu-charset-detector.cpp(7): fatal error C1083: Cannot open include file: 'unicode/ucsdet.h': No such file or directory [....\node_modules\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj]

same here, windows 10

download icu, unpack the includes to ~.node-gyp\5.10.0\include\node

getting this now though:

LINK : fatal error LNK1181: cannot open input file '`icu-config --detect-prefix --ldflags`.lib' [C:\Users\ArmyOfAnarchi
sts\Programming\JS\node-icu-charset-detector\build\node-icu-charset-detector.vcxproj]

I found it is OK after I install ICU

The problem might be a nan module with an old version (since npm v3, it's in the root of node_modules). Updating it to latest version should fix it.