baudehlo / node-fs-ext

Extras missing from node's fs module
MIT License
101 stars 45 forks source link

Installation error with nan 1.5+ #41

Closed timmclean closed 9 years ago

timmclean commented 9 years ago

When installing fs-ext with npm, the compilation step fails with the following errors:

  CXX(target) Release/obj.target/fs-ext/fs-ext.o
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h: In instantiation of ‘typename NanIntern::Factory<T>::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory<T>::return_t = v8::Local<v8::Integer>]’:
../fs-ext.cc:129:112:   required from here
../node_modules/nan/nan_new.h:184:41: error: call of overloaded ‘New(long unsigned int&)’ is ambiguous
   return NanIntern::Factory<T>::New(arg0);
                                         ^
../node_modules/nan/nan_new.h:184:41: note: candidates are:
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h:86:26: note: static NanIntern::IntegerFactory<T>::return_t NanIntern::IntegerFactory<T>::New(int32_t) [with T = v8::Integer; NanIntern::IntegerFactory<T>::return_t = v8::Local<v8::Integer>; int32_t = int]
   static inline return_t New(int32_t value);
                          ^
../node_modules/nan/nan_new.h:87:26: note: static NanIntern::IntegerFactory<T>::return_t NanIntern::IntegerFactory<T>::New(uint32_t) [with T = v8::Integer; NanIntern::IntegerFactory<T>::return_t = v8::Local<v8::Integer>; uint32_t = unsigned int]
   static inline return_t New(uint32_t value);
                          ^
In file included from ../node_modules/nan/nan.h:63:0,
                 from ../fs-ext.cc:27:
../node_modules/nan/nan_new.h: In function ‘typename NanIntern::Factory<T>::return_t NanNew(A0) [with T = v8::Integer; A0 = long unsigned int; typename NanIntern::Factory<T>::return_t = v8::Local<v8::Integer>]’:
../node_modules/nan/nan_new.h:185:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
make: *** [Release/obj.target/fs-ext/fs-ext.o] Error 1

Locking nan to 1.4.1 works around the problem: https://github.com/timmclean/node-fs-ext/commit/f527f55dfac20c931cbfb3cbd6170ba3d1881d08

I'm on Ubuntu 14.04.1 LTS, using Node.js v0.10.33.

Thanks! Tim

baudehlo commented 9 years ago

Fixed and published.