Hello! Can't use node-deflate. Trying to use this code:
var Deflate = require('deflate'); Deflate.deflate(new Buffer([255, 255, 255, 251]), 'deflate');
But it fails with error "bad deflate kind".
I were trying to find out what's the matter, so I suppose it's in the line 378 in deflate.cc: char* strLevel = *String::AsciiValue(args[idx+0]->ToString());
I think so, because there is a value in args[idx+0], but strLevel is empty (or may be pointer is NULL).
As far as I've got it from the description of String::AsciiValue() (http://bespin.cz/~ondras/html/classv8_1_1String_1_1AsciiValue.html), "conversion to a string fails" and * String::AsciiValue() returns NULL.
Could you please tell me what the problem could it be?
var _write = res.write; // save the original write function
res.write = function(data) { // define a new write function
var dd = deflate.inflateSync(data); // deflate?
_write.call(res, data); // call the original write function
};
node(1618) malloc: *** mmap(size=140737488355328) failed (error code=12)
*** error: can't allocate region
*** set a breakpoint in malloc_error_break to debug
Setting srcdir to : nodejs/director/node_modules/deflate
Setting blddir to : nodejs/director/node_modules/deflate/build
Checking for program g++ or c++ : /usr/bin/g++
Checking for program cpp : /usr/bin/cpp
Checking for program ar : /usr/bin/ar
Checking for program ranlib : /usr/bin/ranlib
Checking for g++ : ok
Checking for node path : not found
Checking for node prefix : ok /home/jules
Checking for library z : yes
'configure' finished successfully (0.525s)
Waf: Entering directory nodejs/director/node_modules/deflate/build' [1/2] cxx: src/deflate.cc -> build/default/src/deflate_1.o ../src/deflate.cc:591:2: warning: no newline at end of file ../src/deflate.cc: In static member function ‘static v8::Handle<v8::Value> Flater::SetInput(const v8::Arguments&)’: ../src/deflate.cc:218: error: ‘realloc’ was not declared in this scope ../src/deflate.cc:231: error: ‘malloc’ was not declared in this scope ../src/deflate.cc: In static member function ‘static v8::Handle<v8::Value> Flater::GetOutput(const v8::Arguments&)’: ../src/deflate.cc:339: error: ‘free’ was not declared in this scope ../src/deflate.cc: In function ‘v8::Handle<v8::Value> OnePassDeflate(const v8::Arguments&)’: ../src/deflate.cc:439: error: ‘malloc’ was not declared in this scope ../src/deflate.cc:460: error: ‘free’ was not declared in this scope ../src/deflate.cc: In function ‘v8::Handle<v8::Value> OnePassInflate(const v8::Arguments&)’: ../src/deflate.cc:531: error: ‘malloc’ was not declared in this scope ../src/deflate.cc:546: error: ‘realloc’ was not declared in this scope ../src/deflate.cc:568: error: ‘free’ was not declared in this scope Waf: Leaving directorynodejs/director/node_modules/deflate/build'
Build failed: -> task failed (err #1):
{task: cxx deflate.cc -> deflate_1.o}
npm ERR! error installing [email protected] Error: [email protected] install: ./build.sh
npm ERR! error installing [email protected]sh "-c" "./build.sh" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/home/jules/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] install: ./build.sh
npm ERR! sh "-c" "./build.sh" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the deflate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./build.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls deflate
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.18-194.32.1.el5
npm ERR! command "node" "/home/jules/bin/npm" "install" "deflate"
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! nodejs/director/npm-debug.log
npm not ok
Having trouble installing node-deflate as a dependency of bogart:
npm ERR! error installing [email protected] Error: [email protected] install: ./build.sh
npm ERR! error installing [email protected]sh "-c" "./build.sh" failed with 1
npm ERR! error installing [email protected] at ChildProcess. (/usr/local/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected] at ChildProcess.emit (events.js:67:17)
npm ERR! error installing [email protected] at ChildProcess.onexit (child_process.js:192:12)
npm ERR! [email protected] install: ./build.sh
npm ERR! sh "-c" "./build.sh" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the deflate package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./build.sh
npm ERR! You can get their info via:
npm ERR! npm owner ls deflate
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.35.4-rscloud
npm ERR! command "node" "/usr/local/bin/npm" "install"
npm ERR! cwd /var/www/shaf/node_modules/bogart
npm ERR! node -v v0.4.12
npm ERR! npm -v 1.0.30
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /var/www/shaf/node_modules/bogart/npm-debug.log
npm not ok