Hi,
I tried to install node-zopfli with both npm and node-gyp. The first complains during build, the second finds an undefined variable (or maybe I did something wrong). Can you please take a look at build logs? I'm on node-0.12.7.
installing with npm
$ npm install node-zopfli
|
> node-zopfli@1.4.0 install /home/bkheyfets/node_modules/node-zopfli
> node-pre-gyp install --fallback-to-build
make: Entering directory `/home/bkheyfets/node_modules/node-zopfli/build'
CXX(target) Release/obj.target/zopfli/src/zopfli-binding.o
In file included from ../node_modules/nan/nan_new.h:189:0,
from ../node_modules/nan/nan.h:200,
from ../src/zopfli-binding.h:5,
from ../src/zopfli-binding.cc:3:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:94:67: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
^
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::FunctionTemplate>::return_t Nan::imp::Factory<v8::FunctionTemplate>::New(Nan::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>)’:
../node_modules/nan/nan_implementation_12_inl.h:122:69: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
^
In file included from ../src/zopfli-binding.h:5:0,
from ../src/zopfli-binding.cc:3:
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:1908:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:1913:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1951:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:1960:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::PropertyGetterCallback, Nan::PropertySetterCallback, Nan::PropertyQueryCallback, Nan::PropertyDeleterCallback, Nan::PropertyEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1998:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:2003:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h:2009:57: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(query)));
^
../node_modules/nan/nan.h:2015:59: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(deleter)));
^
../node_modules/nan/nan.h:2021:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(enumerator)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::IndexGetterCallback, Nan::IndexSetterCallback, Nan::IndexQueryCallback, Nan::IndexDeleterCallback, Nan::IndexEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2068:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:2073:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h:2079:57: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(query)));
^
../node_modules/nan/nan.h:2085:59: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(deleter)));
^
../node_modules/nan/nan.h:2091:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(enumerator)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetCallHandler(v8::Local<v8::FunctionTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2124:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(callback)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetCallAsFunctionHandler(v8::Local<v8::ObjectTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2146:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(callback)));
^
../src/zopfli-binding.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE nodezopfli::CompressBinding::Sync(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/zopfli-binding.cc:173:20: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
&out, &outsize);
^
../src/zopfli-binding.cc: In static member function ‘static Nan::NAN_METHOD_RETURN_TYPE nodezopfli::CompressBinding::Async(Nan::NAN_METHOD_ARGS_TYPE)’:
../src/zopfli-binding.cc:105:78: warning: ‘format’ may be used uninitialized in this function [-Wmaybe-uninitialized]
: Nan::AsyncWorker(callback), format(format), zopfli_options(zopfli_options) {
^
../src/zopfli-binding.cc:150:16: note: ‘format’ was declared here
ZopfliFormat format;
^
CXX(target) Release/obj.target/zopfli/src/png/zopflipng.o
In file included from ../node_modules/nan/nan_new.h:189:0,
from ../node_modules/nan/nan.h:200,
from ../src/png/zopflipng.cc:3:
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::Function>::return_t Nan::imp::Factory<v8::Function>::New(Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan_implementation_12_inl.h:94:67: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
^
../node_modules/nan/nan_implementation_12_inl.h: In static member function ‘static Nan::imp::FactoryBase<v8::FunctionTemplate>::return_t Nan::imp::Factory<v8::FunctionTemplate>::New(Nan::FunctionCallback, v8::Local<v8::Value>, v8::Local<v8::Signature>)’:
../node_modules/nan/nan_implementation_12_inl.h:122:69: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, v8::External::New(isolate, reinterpret_cast<void *>(callback)));
^
In file included from ../src/png/zopflipng.cc:3:0:
../node_modules/nan/nan.h: In function ‘void Nan::SetAccessor(v8::Local<v8::ObjectTemplate>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute, Nan::imp::Sig)’:
../node_modules/nan/nan.h:1908:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:1913:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h: In function ‘bool Nan::SetAccessor(v8::Local<v8::Object>, v8::Local<v8::String>, Nan::GetterCallback, Nan::SetterCallback, v8::Local<v8::Value>, v8::AccessControl, v8::PropertyAttribute)’:
../node_modules/nan/nan.h:1951:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:1960:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetNamedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::PropertyGetterCallback, Nan::PropertySetterCallback, Nan::PropertyQueryCallback, Nan::PropertyDeleterCallback, Nan::PropertyEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:1998:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:2003:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h:2009:57: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(query)));
^
../node_modules/nan/nan.h:2015:59: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(deleter)));
^
../node_modules/nan/nan.h:2021:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(enumerator)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetIndexedPropertyHandler(v8::Local<v8::ObjectTemplate>, Nan::IndexGetterCallback, Nan::IndexSetterCallback, Nan::IndexQueryCallback, Nan::IndexDeleterCallback, Nan::IndexEnumeratorCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2068:56: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(getter)));
^
../node_modules/nan/nan.h:2073:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(setter)));
^
../node_modules/nan/nan.h:2079:57: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(query)));
^
../node_modules/nan/nan.h:2085:59: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(deleter)));
^
../node_modules/nan/nan.h:2091:62: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(enumerator)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetCallHandler(v8::Local<v8::FunctionTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2124:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(callback)));
^
../node_modules/nan/nan.h: In function ‘void Nan::SetCallAsFunctionHandler(v8::Local<v8::ObjectTemplate>, Nan::FunctionCallback, v8::Local<v8::Value>)’:
../node_modules/nan/nan.h:2146:58: warning: ISO C++ forbids casting between pointer-to-function and pointer-to-object [-Wpedantic]
, New<v8::External>(reinterpret_cast<void *>(callback)));
^
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/blocksplitter.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/cache.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/deflate.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/gzip_container.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/hash.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/katajainen.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/lz77.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/squeeze.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/tree.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/util.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/zlib_container.o
CC(target) Release/obj.target/zopfli/zopfli/src/zopfli/zopfli_lib.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/zopflipng_lib.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/lodepng/lodepng.o
CXX(target) Release/obj.target/zopfli/zopfli/src/zopflipng/lodepng/lodepng_util.o
SOLINK_MODULE(target) Release/obj.target/zopfli.node
COPY Release/zopfli.node
COPY /home/bkheyfets/node_modules/node-zopfli/lib/binding/node-v14-linux-x64/zopfli.node
TOUCH Release/obj.target/action_after_build.stamp
make: Leaving directory `/home/bkheyfets/node_modules/node-zopfli/build'
node-zopfli@1.4.0 node_modules/node-zopfli
├── nan@2.2.0
├── commander@2.9.0 (graceful-readlink@1.0.1)
├── bluebird@2.10.2
├── defaults@1.0.3 (clone@1.0.2)
└── node-pre-gyp@0.6.19
installing with node-gyp
$ cd node-zopfli-1.4.0
$ node-gyp configure
gyp info it worked if it ends with ok
gyp info using node-gyp@3.2.1
gyp info using node@0.12.7 | linux | x64
gyp info spawn /usr/bin/python2
gyp info spawn args [ '/usr/lib/node_modules/node-gyp/gyp/gyp_main.py',
gyp info spawn args 'binding.gyp',
gyp info spawn args '-f',
gyp info spawn args 'make',
gyp info spawn args '-I',
gyp info spawn args '/home/bkheyfets/zop/node-zopfli-1.4.0/build/config.gypi',
gyp info spawn args '-I',
gyp info spawn args '/usr/lib/node_modules/node-gyp/addon.gypi',
gyp info spawn args '-I',
gyp info spawn args '/home/bkheyfets/.node-gyp/0.12.7/common.gypi',
gyp info spawn args '-Dlibrary=shared_library',
gyp info spawn args '-Dvisibility=default',
gyp info spawn args '-Dnode_root_dir=/home/bkheyfets/.node-gyp/0.12.7',
gyp info spawn args '-Dnode_gyp_dir=/usr/lib/node_modules/node-gyp',
gyp info spawn args '-Dnode_lib_file=node.lib',
gyp info spawn args '-Dmodule_root_dir=/home/bkheyfets/zop/node-zopfli-1.4.0',
gyp info spawn args '--depth=.',
gyp info spawn args '--no-parallel',
gyp info spawn args '--generator-output',
gyp info spawn args 'build',
gyp info spawn args '-Goutput_dir=.' ]
gyp: Undefined variable module_name in binding.gyp while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (/usr/lib/node_modules/node-gyp/lib/configure.js:305:16)
gyp ERR! stack at ChildProcess.emit (events.js:110:17)
gyp ERR! stack at Process.ChildProcess._handle.onexit (child_process.js:1074:12)
gyp ERR! System Linux 3.10.0-327.4.4.el7.x86_64
gyp ERR! command "node" "/usr/bin/node-gyp" "configure"
gyp ERR! cwd /home/bkheyfets/zop/node-zopfli-1.4.0
gyp ERR! node -v v0.12.7
gyp ERR! node-gyp -v v3.2.1
gyp ERR! not ok
Hi, I tried to install
node-zopfli
with both npm and node-gyp. The first complains during build, the second finds an undefined variable (or maybe I did something wrong). Can you please take a look at build logs? I'm on node-0.12.7.installing with npm
installing with node-gyp