GithubHelp home page GithubHelp logo

node-buffertools's Introduction

node-buffertools

Utilities for manipulating buffers.

**Deprecation warning: this module is no longer maintained and doesn't work with newer versions of Node.js.

Most functionality is now available through the native Buffer class.**

Installing the module

Easy! With npm:

npm install buffertools

From source:

node-gyp configure
node-gyp build

Now you can include the module in your project.

require('buffertools').extend();  // extend Buffer.prototype
var buf = new Buffer(42);         // create a 42 byte buffer
buf.clear();                      // clear it!

If you don't want to extend the Buffer class's prototype (recommended):

var buffertools = require('buffertools');
var buf = new Buffer(42);
buffertools.clear(buf);

Methods

Note that most methods that take a buffer as an argument, will also accept a string.

buffertools.extend([object], [object...])

Extend the arguments with the buffertools methods. If called without arguments, defaults to [Buffer.prototype, SlowBuffer.prototype]. Extending prototypes only makes sense for classes that derive from Buffer.

buffertools v1.x extended the Buffer prototype by default. In v2.x, it is opt-in. The reason for that is that buffertools was originally developed for node.js v0.3 (or maybe v0.2, I don't remember exactly when buffers were added) where the Buffer class was devoid of any useful methods. Over the years, it has grown a number of utility methods, some of which conflict with the buffertools methods of the same name, like Buffer#fill().

Buffer#clear()

buffertools.clear(buffer)

Clear the buffer. This is equivalent to Buffer#fill(0). Returns the buffer object so you can chain method calls.

Buffer#compare(buffer|string)

buffertools.compare(buffer, buffer|string)

Lexicographically compare two buffers. Returns a number less than zero if a < b, zero if a == b or greater than zero if a > b.

Buffers are considered equal when they are of the same length and contain the same binary data.

Smaller buffers are considered to be less than larger ones. Some buffers find this hurtful.

Buffer#concat(a, b, c, ...)

buffertools.concat(a, b, c, ...)

Concatenate two or more buffers/strings and return the result. Example:

// identical to new Buffer('foobarbaz')
a = new Buffer('foo');
b = new Buffer('bar');
c = a.concat(b, 'baz');
console.log(a, b, c); // "foo bar foobarbaz"

// static variant
buffertools.concat('foo', new Buffer('bar'), 'baz');

Buffer#equals(buffer|string)

buffertools.equals(buffer, buffer|string)

Returns true if this buffer equals the argument, false otherwise.

Buffers are considered equal when they are of the same length and contain the same binary data.

Caveat emptor: If your buffers contain strings with different character encodings, they will most likely not be equal.

Buffer#fill(integer|string|buffer)

buffertools.fill(buffer, integer|string|buffer)

Fill the buffer (repeatedly if necessary) with the argument. Returns the buffer object so you can chain method calls.

Buffer#fromHex()

buffertools.fromHex(buffer)

Assumes this buffer contains hexadecimal data (packed, no whitespace) and decodes it into binary data. Returns a new buffer with the decoded content. Throws an exception if non-hexadecimal data is encountered.

Buffer#indexOf(buffer|string, [start=0])

buffertools.indexOf(buffer, buffer|string, [start=0])

Search this buffer for the first occurrence of the argument, starting at offset start. Returns the zero-based index or -1 if there is no match.

Buffer#reverse()

buffertools.reverse(buffer)

Reverse the content of the buffer in place. Example:

b = new Buffer('live');
b.reverse();
console.log(b); // "evil"

Buffer#toHex()

buffertools.toHex(buffer)

Returns the contents of this buffer encoded as a hexadecimal string.

Classes

Singular, actually. To wit:

WritableBufferStream

This is a regular node.js writable stream that accumulates the data it receives into a buffer.

Example usage:

// slurp stdin into a buffer
process.stdin.resume();
ostream = new WritableBufferStream();
util.pump(process.stdin, ostream);
console.log(ostream.getBuffer());

The stream never emits 'error' or 'drain' events.

WritableBufferStream.getBuffer()

Return the data accumulated so far as a buffer.

TODO

  • Logical operations on buffers (AND, OR, XOR).
  • Add lastIndexOf() functions.

License

Copyright (c) 2010, Ben Noordhuis [email protected]

Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.

THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

node-buffertools's People

Contributors

bnoordhuis avatar justmoon avatar schloerke avatar skogsmaskin avatar tootallnate avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

node-buffertools's Issues

Compare obey lexicographical order

I suppose this is not technically a bug, but it would be great to have compare act more like a standard comparison algorithm so that buffers can be sorted "properly". That is, sorting buffers containing ascii text should sort the same way as sorting the same text lexicographically.

So, if you have the following buffers with the following bytes:
A: 00 00 00 00 (length 4)
B: ff ff (length 2)
C: ff ff 00 (length 3)
D: ff ff 01 (length 3)

They should sort as A, B, C, D.
The current compare algorithm would cause them to be sorted as B, C, D, A.

Buffertools Buffer.fill Override

I've been relying on Buffer.fill working as documented at the Node docs, but it appears that buffertools overrides something in the default Buffer causing offset and end to be ignored.

var test = function() {
    var buffer = new Buffer(8);
    buffer.fill(0);
    buffer.fill(0x44, 1, 2);
    console.log(buffer); // should _always_ print 00 44 00 00
};

test(); // prints 00 44 00 00
var buffertools = require('buffertools');
test(); // prints 44 44 44 44

I can't tell if this is intended to be a feature or a bug, as it's documented this way in the README, but from my perspective this is a bug.

The only real work-around or fix I have is to comment out the two lines that modify Buffer.prototype and SlowBuffer.prototype in buffertools.js:

for (var key in buffertools) {
    var val = buffertools[key];
    // SlowBuffer.prototype[key] = val;
    // Buffer.prototype[key] = val;
    exports[key] = val;
}

You can still use methods like Buffer.equals, however, though you need to be a little hacky about it:

var buffertools = require('buffertools');

var buffer = new Buffer(16), buffer2 = new Buffer(buffer);
buffertools.equals.call(buffer, buffer2); // => true

buffertools 1.0.8 doesn't install with npm

npm update buffertools spits out:

File "/usr/local/bin/node-waf", line 16, in
Scripting.prepare(t, os.getcwd(), VERSION, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 145, in prepare
prepare_impl(t, cwd, ver, wafdir)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 135, in prepare_impl
main()
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 188, in main
fun(ctx)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 386, in build
return build_impl(bld)
File "/usr/local/bin/../lib/node/wafadmin/Scripting.py", line 405, in build_impl
bld.compile()
File "/usr/local/bin/../lib/node/wafadmin/Build.py", line 268, in compile
os.chdir(self.bldnode.abspath())
OSError: [Errno 2] No such file or directory: '/home/bnoordhuis/src/nodejs/node-buffertools/build'

Glitch in `Buffer#indexOf`, with repro case.

The new indexOf looks nice! Thanks for implementing it. This, however, seems to fail:

endOfHeader = new Buffer('\r\n\r\n');
assert.equal(0, endOfHeader.indexOf(endOfHeader));
assert.equal(0, endOfHeader.indexOf('\r\n\r\n'));

Both assert statements will fail currently. indexOf cant seem to detect a '\r\n\r\n' sequence...

Breaking change in VS2013 STL

I'm building your awesome module with VS2013, and unfortunately it fails:

error C2039: 'min' is not a member of 'std'

This seems to be due to a breaking change in the STL. Under the "Breaking Changes" section, the first item states:

  • You must #include <algorithm> when calling std::min() or std::max().

Could you make this slight change wherever it needs it? Also, it would probably be nice to check the rest of the changes section to make sure nothing else is broken, but I imagine that's the only problem.

Windows 8 buffertools fails at `node-gyp rebuild`

10805 error [email protected] install: `node-gyp rebuild`
10805 error Exit status 1
10806 error Failed at the [email protected] install script.
10806 error This is most likely a problem with the buffertools package,
10806 error not with npm itself.
10806 error Tell the author that this fails on your system:
10806 error     node-gyp rebuild
10806 error You can get their info via:
10806 error     npm owner ls buffertools
10806 error There is likely additional logging output above.
10807 error System Windows_NT 6.2.9200
10808 error command "C:\\Program Files (x86)\\nodejs\\\\node.exe" "C:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install"
10809 error cwd C:\Users\wildeyes\Documents\Pi6
10810 error node -v v0.10.22
10811 error npm -v 1.3.14
10812 error code ELIFECYCLE
10813 verbose exit [ 1, true ]

:(

new Buffer('').reverse() crashes on windows

  • node v0.10.6
  • node-buffertools @072038b6ee2f4e34965e61b20bb9425f3253c554
  • 32 bit windows 7

Taking a look at helping with #21 I noticed that running node test.js on windows exits prematurely. It appears the tests run fine (without failures) up until the new Buffer('').reverse() call and then node simply exits silently (I presume due to a c land crash).

Buffertools Segfault

Hi when trying to use to run node test.js this will segfault.

[New Thread 0xb7cccb40 (LWP 19058)]

Program received signal SIGSEGV, Segmentation fault.
0xb7fd6240 in (anonymous namespace)::Reverse(v8::Arguments const&) ()

I'm not sure how to get any more details then this.

pretty broken on v0.11.11

it has all kinds of strange compile errors (stuff to do with gid_t). I tried fixing it this morning... I was interested to see if your Buffer implementation would work in 0.11.11 ...

anyway it appears I did figure it out, and the changes aren't that hard, so I thought I'd leave you the link to the commit so you can pick up some of the easy fixes for buffer:

duralog/node-imagemagick-native@e5e723c

cheers!

core file in npm install

I think you've accidentally left a core file in the current npm install. npm install buffertools puts a large core file in the top directory. The version is 1.1.0

Error with npm install

Receiving an error when trying to run npm-install, seems to stem from buffertools ...

buffertools

Visual Studio build fails

Since you added a call to snprintf, npm is no longer able to build buffertools using Visual Studio:

..\buffertools.cc(431): error C3861: 'snprintf': identifier not found

Believe it or not, even Visual Studio 2013 does not appear to support snprintf.

The suggested workaround is:

#if _MSC_VER
#define snprintf _snprintf
#endif

Offer a mode that doesn't modify global prototypes

Modifying the Buffer and SlowBuffer prototypes is convenient, but it would be nice to have a mode that allowed a module to use the methods, without forcing the script using the module to have the functions as well.

I don't think it would be possible to modify the prototype of Buffer for a single module, and not globally, so I think the best way to do it would be to offer a special, extended Buffer object exported on the buffertools module. That way you could create instances of these extended buffers at will. And then, to extend normal buffer instances, offer a buffertools.extend(buffer) function, that alters the __proto__ variable of that instance.

indexOf sometimes incorrectly returns -1

indexOf sometimes incorrectly returns -1 when checking for indexOf("=yend") with the buffer in this test case:

var util = require('util'),
    buffertools = require('buffertools'),
    buffer = new Buffer("9A8B3F4491734D18DEFC6D2FA96A2D3BC1020EECB811F037F977D039B4713B1984FBAB40FCB4D4833D4A31C538B76EB50F40FA672866D8F50D0A1063666721B8D8322EDEEC74B62E5F5B959393CD3FCE831CC3D1FA69D79C758853AFA3DC54D411043263596BAD1C9652970B80869DD411E82301DF93D47DCD32421A950EF3E555152E051C6943CC3CA71ED0461B37EC97C5A00EBACADAA55B9A7835F148DEF8906914617C6BD3A38E08C14735FC2EFE075CC61DFE5F2F9686AB0D0A3926604E320160FDC1A4488A323CB4308CDCA4FD9701D87CE689AF999C5C409854B268D00B063A89C2EEF6673C80A4F4D8D0A00163082EDD20A2F1861512F6FE9BB479A22A3D4ACDD2AA848254BA74613190957C7FCD106BF7441946D0E1A562DA68BC37752B1551B8855C8DA08DFE588902D44B2CAB163F3D7D7706B9CC78900D0AFD5DAE5492535A17DB17E24389F3BAA6F5A95B9F6FE955193D40932B5988BC53E49CAC81955A28B81F7B36A1EDA3B4063CBC187B0488FCD51FAE71E4FBAEE56059D847591B960921247A6B7C5C2A7A757EC62A2A2A2A2A2A2A25552591C03EF48994BD9F594A5E14672F55359EF1B38BF2976D1216C86A59847A6B7C4A5C585A0D0A2A6D9C8F8B9E999C2A836F786D577A79816F7C577A797D7E576B506B57A05B5B8C4A8D99989E8B8D9E644A6B9D9D8F9C9E4A504A6B968B93984A93984A988FA19D919C999F9A4A8B969E588C93988B9C938F9D588D8B9C9E9999989D58909C8F988D92588E0D0A3D79656E642073697A653D373035393620706172743D31207063726333323D33616230646235300D0A2E0D0A").fromHex();
    
util.log(buffer.indexOf("=yend") + ' (expecting 551)');

If you save that to a file and run it with node test.js over and over again, it will sometimes output -1 and sometimes output 551 (the expected value).

optional offset parameters for some methods

Would it be possible to extend the following methods with an optional "offset" parameter? By default the parameter would take the value '0', and would behave exactly as of now, thus staying backward compatible. Something like:

  • Buffer.compare(buffer|string, thatOffset = 0, thisOffset = 0):
    compares this buffer starting at thisOffset till end to the given buffer/string starting at thatOffset.
  • Buffer.indexOf(buffer|string, thisOffset = 0):
    Search this buffer for the first occurrence of the given buffer, starting from thisOffset.
  • Buffer.equals(buffer|string, thisOffset = 0, length = buffer.length):
    checks if the given buffer equals to this buffer, starting from thisOffset, on the first length bytes.

Thanks.

collect2: ld returned 1 exit status

Hi

my system is Debian Squeeze with some pinning, Linux 2.6.32-5-amd64 #1 SMP Sun May 6 04:00:17 UTC 2012 x86_64 GNU/Linux

Configure is fine I thing:

$ node-gyp configure --verbose
info it worked if it ends with ok 
verb command 'configure' [] 
verb checking for Python executable "python" in the PATH 
verb `which` succeeded for `python` '/usr/bin/python' 
verb no --target version specified, falling back to host node version 'v0.6.19' 
verb command 'install' [ 'v0.6.19' ] 
verb input version string 'v0.6.19' 
verb installing legacy version? true 
verb installing version '0.6.19' 
verb --ensure was passed, so won't reinstall if already installed 
verb version is already installed, need to check "installVersion" 
verb got "installVersion": 8 
verb needs "installVersion": 7 
verb version is good 
verb target node version installed: '0.6.19' 
verb attempting to create "build" dir '/root/node-buffertools/build' 
verb "build" dir needed to be created? true 
verb creating build/config.gypi file 
verb writing out config file '/root/node-buffertools/build/config.gypi' 
verb gyp format was not specified; forcing "make" 
spawn python [ '/root/.node-gyp/0.6.19/tools/gyp_addon',
  'binding.gyp',
  '-I/root/node-buffertools/build/config.gypi',
  '-f',
  'make' ]
info done ok 

But something bad happens when I build:

$ node-gyp build --verbose
info it worked if it ends with ok 
verb command 'build' [] 
verb build args [] 
verb build type: 'Release' 
verb architecture: 'x64' 
verb node dev dir: '/root/.node-gyp/0.6.19' 
verb `which` succeeded for `make` '/usr/bin/make' 
spawn make [ 'V=1', 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/root/node-buffertools/build'
  g++ '-D_LARGEFILE_SOURCE' '-D_FILE_OFFSET_BITS=64' -I/root/.node-gyp/0.6.19/src -I/root/.node-gyp/0.6.19/deps/uv/include -I/root/.node-gyp/0.6.19/deps/v8/include  -fPIC -Wall -pthread -O3 -fdata-sections -ffunction-sections -fno-strict-aliasing -fno-rtti -fno-exceptions -MMD -MF ./Release/.deps/Release/obj.target/buffertools/buffertools.o.d.raw  -c -o Release/obj.target/buffertools/buffertools.o ../buffertools.cc
  flock ./Release/linker.lock g++ -shared -pthread -rdynamic  -Wl,-soname=buffertools.node -o Release/obj.target/buffertools.node -Wl,--start-group Release/obj.target/buffertools/buffertools.o -Wl,--end-group 
/usr/bin/ld: /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a(functexcept.o): relocation R_X86_64_32 against `std::bad_typeid::~bad_typeid()' can not be used when making a shared object; recompile with -fPIC
/usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [Release/obj.target/buffertools.node] Error 1
make: Leaving directory `/root/node-buffertools/build'
ERR! Error: `make` failed with exit code: 2
    at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:212:23)
    at ChildProcess.emit (events.js:70:17)
    at maybeExit (child_process.js:362:16)
    at Process.onexit (child_process.js:398:5)
ERR! not ok

I've tried npm at 1.0.9, 1.0.8 and git master without success

Unfortunately I don't understand why this is happens. I have similarly configured system elsewhere and there is no error.
Can anybody help me?

Thanks Pavel

Please make it compatible with .net 4.5.

npm http GET https://registry.npmjs.org/verror/1.1.0

C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(983,5):
warning MSB3644: The reference assemblies for framework ".NETFramework,Version=
v4.0" were not found. To resolve this, install the SDK or Targeting Pack for th
is framework version or retarget your application to a version of the framework
for which you have the SDK or Targeting Pack installed. Note that assemblies w
ill be resolved from the Global Assembly Cache (GAC) and will be used in place
of reference assemblies. Therefore your assembly may not be correctly targeted
for the framework you intend. [C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\lda
pjs\node_modules\buffertools\build\buffertools.vcxproj]

Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.

C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\Platforms\x64\Microsoft.Cpp.x
64.Targets(146,5): error MSB6006: "CL.exe" exited with code -1073741515. [C:\Te
amCityCheckout\EPCMAPI\DEV\node_modules\ldapjs\node_modules\buffertools\build\b
uffertools.vcxproj]
npm http 304 https://registry.npmjs.org/dtrace-provider/0.2.7
gyp ERR! build error
gyp ERR! stacknpm Error: C:\Windows\Microsoft.NET\Framework\v4.0.30319\msbuild. exe failed with exit code: 1
http 304C:\Windows\Microsoft.NET\Framework\v4.0.30319\Microsoft.Common.Targets(
983,5):
https://registry.npmjs.org/mv/0.0.4
warning MSB3644: The reference assemblies for framework ".NETFramework,Version=
v4.0" were not found. To resolve this, install the SDK or Targeting Pack for th
is framework version or retarget your application to a version of the framework
gyp for which you have the SDK or Targeting Pack installed. Note that assemblies
w
ill be resolved from the Global Assembly Cache (GAC) and will be used in place
of reference assemblies. Therefore your assembly may not be correctly targeted
for the framework you intend. [C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\lda

pjs\node_modules\dtrace-provider\build\DTraceProviderStub.vcxproj]
ERR! stack at ChildProcess.onExit (C:\Program Files\nodejs\node_modules\npm
node_modules\node-gyp\lib\build.js:236:23)
gyp ERR! stack at ChildProcess.EventEmitter.emit (events.js:99:17)
gyp ERR! stack at Process._handle.onexit (child_process.js:678:10)
gyp ERR! System Windows_NT 6.1.7601
gyp ERR! command "node" "C:\Program Files\nodejs\node_modules\npm\node_modu
les\node-gyp\bin\node-gyp.js" "rebuild"
gyp ERR! cwd C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\ldapjs\node_modules\bu
ffertools
gyp ERR! node -v v0.8.15
gyp ERR! node-gyp -v v0.7.1
gyp ERR! not ok
npm http 304 https://registry.npmjs.org/verror/1.1.0
npm http 200 https://registry.npmjs.org/jsprim/0.3.0
npm ERR! error rolling back Error: ENOTEMPTY, rmdir 'C:\TeamCityCheckout\EPCMAPI
\DEV\node_modules\ldapjs\node_modules\bunyan\node_modules\dtrace-provider\libusd
t'
npm ERR! error rolling back [email protected] { [Error: ENOTEMPTY, rmdir 'C:\TeamCit
yCheckout\EPCMAPI\DEV\node_modules\ldapjs\node_modules\bunyan\node_modules\dtrac
e-provider\libusdt']
npm ERR! error rolling back errno: 53,
npm ERR! error rolling back code: 'ENOTEMPTY',
npm ERR! error rolling back path: 'C:\TeamCityCheckout\EPCMAPI\DEV\node_mo
dules\ldapjs\node_modules\bunyan\node_modules\dtrace-provider\libusdt' }
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! cmd "/c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd C:\TeamCityCheckout\EPCMAPI\DEV
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! code ELIFECYCLE
npm ERR! Error: ENOENT, lstat 'C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\ldap
js\node_modules\bunyan\node_modules\dtrace-provider\libusdt\test.pl'
npm ERR! If you need help, you may report this log at:
npm ERR! http://github.com/isaacs/npm/issues
npm ERR! or email it to:
npm ERR! [email protected]

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "C:\Program Files\nodejs\node.exe" "C:\Program Files\nod
ejs\node_modules\npm\bin\npm-cli.js" "install"
npm ERR! cwd C:\TeamCityCheckout\EPCMAPI\DEV
npm ERR! node -v v0.8.15
npm ERR! npm -v 1.1.66
npm ERR! path C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\ldapjs\node_modules\b
unyan\node_modules\dtrace-provider\libusdt\test.pl
npm ERR! fstream_path C:\TeamCityCheckout\EPCMAPI\DEV\node_modules\ldapjs\node_m
odules\bunyan\node_modules\dtrace-provider\libusdt\test.pl
npm ERR! fstream_type File
npm ERR! fstream_class FileWriter
npm ERR! code ENOENT
npm ERR! errno 34
npm ERR! fstream_stack Writer._finish.er.fstream_finish_call (C:\Program Files\n
odejs\node_modules\npm\node_modules\fstream\lib\writer.js:284:26)
npm ERR! fstream_stack Object.oncomplete (fs.js:297:15)
npm http GET https://registry.npmjs.org/jsprim/-/jsprim-0.3.0.tgz
npm http 200 https://registry.npmjs.org/jsprim/-/jsprim-0.3.0.tgz
npm http GET https://registry.npmjs.org/extsprintf/1.0.0
npm http GET https://registry.npmjs.org/json-schema/0.2.2
npm http GET https://registry.npmjs.org/verror/1.3.3
npm http 304 https://registry.npmjs.org/extsprintf/1.0.0
npm http 304 https://registry.npmjs.org/json-schema/0.2.2
npm http 304 https://registry.npmjs.org/verror/1.3.3
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! C:\TeamCityCheckout\EPCMAPI\DEV\npm-debug.log
npm ERR! not ok code 0

Support concat() with Arrays

What I most often end up doing is the following:

var bufflist = [];
response.on('data', function (chunk) { bufflist.push(chunk) });
response.on('end', function () { var buf = buffertools.concat.apply(buffertools, bufflist); ... });

Which would be more efficient if you could do concat() with Arrays.

I may try and patch this in, but the C++ stuff isn't my expertise (yet). If it's easy I would suggest you do it rather than me :)

pre-built download?

can you offer a pre-built download for buffertools, so that those of us on windows can just download and use it?
i actually just wanna use 'https://github.com/eleith/emailjs' but it requires this module

edit: it seems that 'emailjs' only requires the 'buffertools.concat' function, so if its not possible to provide a pre-built download, can you please tell me what's the difference between 'buffertools.concat' and 'Array.prototype.concat'?

Publish to npm

Why not go ahead and publish this package to npm? It's pretty much the de facto for Node, and would make including this package in projects a breeze. Thanks!

Undeclared libuv dependency

> [email protected] install /Users/R2D2/Sites/vote/node_modules/buffertools
> node-gyp rebuild

  CXX(target) Release/obj.target/buffertools/buffertools.o
In file included from ../buffertools.cc:17:
/Users/R2D2/.node-gyp/0.10.15/src/node.h:61:10: fatal error: 'uv.h' file not found
#include "uv.h"
         ^
1 error generated.
make: *** [Release/obj.target/buffertools/buffertools.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/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:789:12)
gyp ERR! System Darwin 12.4.0
gyp ERR! command "node" "/usr/local/Cellar/node/0.10.15/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /Users/R2D2/Sites/vote/node_modules/buffertools
gyp ERR! node -v v0.10.15
gyp ERR! node-gyp -v v0.10.6
gyp ERR! not ok
npm ERR! weird error 1
npm ERR! not ok code 0

Need to install libuv

Unable to build (Linux)

I can build just fine on OS X (dependency to emailjs).

Both dev and production environments:
node --version is 0.6.10
python --version is 2.7.1+

npm install on production yields:

> ./build-wrapper

Traceback (most recent call last):
  File "./build-wrapper", line 8, in <module>
    status = subprocess.call('node-waf configure build'.split())
  File "/usr/lib/python2.7/subprocess.py", line 486, in call
    return Popen(*popenargs, **kwargs).wait()
  File "/usr/lib/python2.7/subprocess.py", line 672, in __init__
    errread, errwrite)
  File "/usr/lib/python2.7/subprocess.py", line 1213, in _execute_child
    raise child_exception
OSError: [Errno 2] No such file or directory
npm ERR! error installing [email protected]
npm ERR! error installing [email protected]

npm ERR! [email protected] preinstall: `./build-wrapper`
npm ERR! `sh "-c" "./build-wrapper"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./build-wrapper
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 2.6.38-13-generic-pae
npm ERR! command "node" "/usr/bin/npm" "install"
npm ERR! cwd /var/www/test-rocket
npm ERR! node -v v0.6.10
npm ERR! npm -v 1.1.1
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] preinstall: `./build-wrapper`
npm ERR! message `sh "-c" "./build-wrapper"` failed with 1
npm ERR! errno {}

I'm sure it's something I haven't set up properly.
Any help is much appreciated.

add Stream implementations that encapsulate Buffers

Maybe I am missing something, but is there a simple way to get what Java people call a ByteArrayOutputStream and ByteArrayInputStream?

If not, node-buffertools would a good place to add such a facility.

failure to install with node v0.6.3

Installs fine with node v0.6.2, but fails with v0.6.3.
(It was Travis CI that first alerted me to the problem. Hooray for CI.)

> [email protected] preinstall /home/mike/tmp/tedious/node_modules/buffertools
> ./build-wrapper

sh: ./build-wrapper: Permission denied
npm ERR! error installing [email protected] Error: [email protected] preinstall: `./build-wrapper`
npm ERR! error installing [email protected] `sh "-c" "./build-wrapper"` failed with 126
npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/home/mike/.nvm/v0.6.3/lib/node_modules/npm/lib/utils/exec.js:49:20)
npm ERR! error installing [email protected]     at ChildProcess.emit (events.js:70:17)
npm ERR! error installing [email protected]     at maybeExit (child_process.js:359:16)
npm ERR! error installing [email protected]     at Process.onexit (child_process.js:395:5)
npm ERR! [email protected] preinstall: `./build-wrapper`
npm ERR! `sh "-c" "./build-wrapper"` failed with 126
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.

Segmentation fault in boyermoore_search

When searching a string in a buffer whose length is smaller than the length of the searched string, a segmentation fault error occurs in 'boyermoore_search'. To reproduce just run the following example:

var buffertools = require('buffertools');
var test = new Buffer('p');
var i = test.indexOf('asdfasdfasdfkasdj');

As workaround, I'm just checking the length of the buffer before using indexOf, but I'd have expected that indexOf makes this check itself.

Hope this is solved soon.
Thank you!

Does this work on Windows?

(Apologies if this is a dumb question.) When I installed on OSX I noticed that it compiled some C++ stuff... Assuming this means buffertools won't work on Windows?

[email protected] fails to install on openSUSE 13.1

Unfortunatelly, it fails to install with npm:

gyp ERR! build error
gyp ERR! stack Error: `make` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/lib64/node_modules/npm/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:784:12)
gyp ERR! System Linux 3.11.6-4-desktop
gyp ERR! command "node" "/usr/lib64/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /usr/lib/node_modules/buffertools
gyp ERR! node -v v0.10.5
gyp ERR! node-gyp -v v0.9.5
gyp ERR! not ok
npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.11.6-4-desktop
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "-g" "buffertools"
npm ERR! cwd /usr/lib/node_modules
npm ERR! node -v v0.10.5
npm ERR! npm -v 1.2.18
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR!     /usr/lib/node_modules/npm-debug.log
npm ERR! not ok code 0

Some additional info:

npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools
In file included from /usr/include/node/node.h:67:0,
                 from ../buffertools.cc:17:
/usr/include/node/node_object_wrap.h: In destructor โ€˜virtual node::ObjectWrap::~ObjectWrap()โ€™:
/usr/include/node/node_object_wrap.h:51:14: error: base operand of โ€˜->โ€™ has non-pointer type โ€˜v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >โ€™
       handle_->SetPointerInInternalField(0, 0);
              ^
/usr/include/node/node_object_wrap.h: In static member function โ€˜static T* node::ObjectWrap::Unwrap(v8::Handle<v8::Object>)โ€™:
/usr/include/node/node_object_wrap.h:62:36: error: โ€˜class v8::Objectโ€™ has no member named โ€˜GetPointerFromInternalFieldโ€™
     return static_cast<T*>(handle->GetPointerFromInternalField(0));
                                    ^
/usr/include/node/node_object_wrap.h: In member function โ€˜void node::ObjectWrap::Wrap(v8::Handle<v8::Object>)โ€™:
/usr/include/node/node_object_wrap.h:72:53: error: no matching function for call to โ€˜v8::Persistent<v8::Object, v8::NonCopyablePersistentTraits<v8::Object> >::New(v8::Handle<v8::Object>&)โ€™
     handle_ = v8::Persistent<v8::Object>::New(handle);
                                                     ^
/usr/include/node/node_object_wrap.h:72:53: note: candidate is:
In file included from /usr/include/node/node.h:62:0,
                 from ../buffertools.cc:17:
/usr/include/v8.h:5591:4: note: static T* v8::Persistent<T, M>::New(v8::Isolate*, T*) [with T = v8::Object; M = v8::NonCopyablePersistentTraits<v8::Object>]
 T* Persistent<T, M>::New(Isolate* isolate, T* that) {
    ^
/usr/include/v8.h:5591:4: note:   candidate expects 2 arguments, 1 provided
In file included from /usr/include/node/node.h:67:0,
...

libv8-3 is installed on my system along with v8-devel and v8-private-headers-devel. What else is required?

ยซReturns a number smaller than 1 if a < bยป

The README.md file currently says that Buffer.compare(buffer|string) returns a number smaller thanย 1 ifย aย <ย b, zero ifย aย ==ย b or aย number larger thanย 1 ifย aย >ย b.

That's either weird orย aย typo (youย probably meant 0 instead of 1).

buffertools fails to install on archlinux

I tried to install to RaspberryPi (arclinux) and installation fails.

[xx@alarmpi src]# npm install buffertools
npm WARN package.json [email protected] No README.md file found!
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools

[email protected] install /root/project/src/node_modules/buffertools
node-gyp rebuild

gyp http GET http://nodejs.org/dist/v0.10.2/node-v0.10.2.tar.gz
gyp http 200 http://nodejs.org/dist/v0.10.2/node-v0.10.2.tar.gz
gyp ERR! build error
gyp ERR! stack Error: not found: make
gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:43:28)
gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:46:29)
gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:57:16
gyp ERR! stack at Object.oncomplete (fs.js:107:15)
gyp ERR! System Linux 3.6.11-6-ARCH+
gyp ERR! command "node" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /root/project/src/node_modules/buffertools
gyp ERR! node -v v0.10.2
gyp ERR! node-gyp -v v0.9.3
gyp ERR! not ok
npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Linux 3.6.11-6-ARCH+
npm ERR! command "/usr/bin/node" "/usr/bin/npm" "install" "buffertools"
npm ERR! cwd /root/project/src
npm ERR! node -v v0.10.2
npm ERR! npm -v 1.2.15
npm ERR! code ELIFECYCLE
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /root/project/src/npm-debug.log
npm ERR! not ok code 0

buffertools fails to install on node 0.5.5 (Linux)

Hello,

My module takes a dependency on buffertools (which I <3 by the way), and someone reported to me that installation was failing on Linux. I looked into it a little, and on an Ubuntu box with node 0.5.5 and npm 1.0.27, buffertools is doing this:

buffertools = require('./build/default/buffertools.node');

Which seems to have gone away for some reason on 0.5:

$ ls node_modules/ldapjs/node_modules/buffertools/build/
c4che  config.log  Release

$ ls node_modules/ldapjs/node_modules/buffertools/build/Release/
buffertools_1.o  buffertools.node

The waf paths are correct for 0.4, just not 0.5.

m

buffertools fails to install (OS X, node.js 0.8.8)

I'm getting an error trying to install buffer tools. I have node-gyp installed globally. Below is the last part of the npm-debug.log file that has the information about the error:

93 info postuninstall [email protected]
94 error [email protected] install: node-gyp rebuild
94 error sh "-c" "node-gyp rebuild" failed with 1
95 error Failed at the [email protected] install script.
95 error This is most likely a problem with the buffertools package,
95 error not with npm itself.
95 error Tell the author that this fails on your system:
95 error node-gyp rebuild
95 error You can get their info via:
95 error npm owner ls buffertools
95 error There is likely additional logging output above.
96 error System Darwin 12.0.0
97 error command "node" "/usr/local/bin/npm" "install" "buffertools"
98 error cwd /Users/scot
99 error node -v v0.8.8
100 error npm -v 1.1.59
101 error code ELIFECYCLE
102 verbose exit [ 1, true ]

thoughts?

Update for Node's new C++ Buffer API

As of Node v0.3, there' a new internal API for Buffers. After getting it to compile (see #1), anything I try calling gives an assertion error:

assert(0 && "v0.3 API change: Use node::Buffer::Data().");

I sadly don't recall C well enough to figure out all of the pointer stuff again, or I'd attach a pull request for you. Hopefully you could get to it soon, thanks!

Error by installation

Greetings,
if I try to install the buffertools plugin, an error occured:

======================>>>
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.
======================>>>

Can you help me?
Thank you!
Michael

`concat` should check if 'this' is a Buffer instance.

If concat is called on a Buffer instance directly, it should use 'this' as the first Buffer in the series. I.E.:

Buffer('hello').concat(' world').toString()
  --> 'hello world'

The current behavior disregards 'this':

Buffer('hello').concat(' world').toString()
  --> ' world'

./build/Release might be ./build/Debug

it looks like node may decide to build debug versions, resulting in a ./build/Debug folder instead of the ./build/Release folder.

This wouldn't be a problem, but the buffertools.js file hard-wires ./build/Release which means that it can't work with debug builds :-)

1.0.8 will not install on CentOS

When installing the latest version of buffertools (1.0.8), the install fails on CentOS. When I install 1.0.7, then it succeeds.

npm install buffertools
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools

[email protected] install /data/node/vastjs/node_modules/buffertools
node-gyp rebuild

info it worked if it ends with ok
spawn python [ '/home/tommy/.node-gyp/0.6.14/tools/gyp_addon',
'binding.gyp',
'-I/data/node/vastjs/node_modules/buffertools/build/config.gypi',
'-f',
'make' ]
Traceback (most recent call last):
File "/home/tommy/.node-gyp/0.6.14/tools/gyp_addon", line 14, in ?
import gyp
File "/home/tommy/.node-gyp/0.6.14/tools/gyp/pylib/gyp/init.py", line 8, in ?
import gyp.input
File "/home/tommy/.node-gyp/0.6.14/tools/gyp/pylib/gyp/input.py", line 14, in ?
import gyp.common
File "/home/tommy/.node-gyp/0.6.14/tools/gyp/pylib/gyp/common.py", line 373
with open(source_path) as source_file:
^
SyntaxError: invalid syntax
ERR! Error: gyp_addon failed with exit code: 1
at Array.0 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:196:18)
at EventEmitter._tickCallback (node.js:192:40)
ERR! not ok

npm ERR! [email protected] install: node-gyp rebuild
npm ERR! sh "-c" "node-gyp rebuild" failed with 1
npm ERR!
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! node-gyp rebuild
npm ERR! You can get their info via:
npm ERR! npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR!
npm ERR! System Linux 2.6.18-274.17.1.el5xen
npm ERR! command "node" "/usr/local/bin/npm" "install" "buffertools"
npm ERR! cwd /data/node/vastjs
npm ERR! node -v v0.6.14
npm ERR! npm -v 1.1.12
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: node-gyp rebuild
npm ERR! message sh "-c" "node-gyp rebuild" failed with 1
npm ERR! errno {}

npm ERR! Error: EACCES, open 'npm-debug.log'
npm ERR!
npm ERR! Please try running this command again as root/Administrator.
npm ERR!
npm ERR! System Linux 2.6.18-274.17.1.el5xen
npm ERR! command "node" "/usr/local/bin/npm" "install" "buffertools"
npm ERR! cwd /data/node/vastjs
npm ERR! node -v v0.6.14
npm ERR! npm -v 1.1.12
npm ERR! path npm-debug.log
npm ERR! code EACCES
npm ERR! message EACCES, open 'npm-debug.log'
npm ERR! errno {}
npm ERR!
npm ERR! Additional logging details can be found in:
npm ERR! /data/node/vastjs/npm-debug.log
npm not ok

buffertools broken in 0.6.11

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Unable to load shared library /node_modules/buffertools/buffertools.node
    at Object..node (module.js:472:11)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)
    at Module.require (module.js:354:17)
    at require (module.js:370:17)
    at Object.<anonymous> (/node_modules/buffertools/buffertools.js:1:77)
    at Module._compile (module.js:441:26)
    at Object..js (module.js:459:10)
    at Module.load (module.js:348:31)
    at Function._load (module.js:308:12)

Don't know if it is an node or buffertools bug. Everything works fine in 0.6.10.

Segmentation fault on "npm install buffertools"

I am trying to install buffertools because it is a prerequisite of emailjs. When I run "npm install buffertools", this is the following shell output:

# npm install buffertools
npm http GET https://registry.npmjs.org/buffertools
npm http 304 https://registry.npmjs.org/buffertools

> [email protected] install /root/Desktop/edge/www/srv/node_modules/buffertools
> node-gyp rebuild

info it worked if it ends with ok 
spawn python [ '/root/.node-gyp/0.6.17/tools/gyp_addon',
  'binding.gyp',
  '-I/root/Desktop/edge/www/srv/node_modules/buffertools/build/config.gypi',
  '-f',
  'make' ]
spawn make [ 'BUILDTYPE=Release', '-C', 'build' ]
make: Entering directory `/root/Desktop/edge/www/srv/node_modules/buffertools/build'
  CXX(target) Release/obj.target/buffertools/buffertools.o
  SOLINK_MODULE(target) Release/obj.target/buffertools.node
  SOLINK_MODULE(target) Release/obj.target/buffertools.node: Finished
  COPY Release/buffertools.node
make: Leaving directory `/root/Desktop/edge/www/srv/node_modules/buffertools/build'
info done ok 
/usr/lib/node_modules/npm/bin/node-gyp-bin/node-gyp: line 2: 17144 Segmentation fault      node "`dirname "$0"`/../../node_modules/node-gyp/bin/node-gyp.js" "$@"

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `sh "-c" "node-gyp rebuild"` failed with 139
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 2.6.32.12-0.7-pae
npm ERR! command "node" "/usr/bin/npm" "install" "buffertools"
npm ERR! cwd /root/Desktop/edge/www/srv
npm ERR! node -v v0.6.17
npm ERR! npm -v 1.1.21
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-gyp rebuild`
npm ERR! message `sh "-c" "node-gyp rebuild"` failed with 139
npm ERR! errno {}
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /root/Desktop/edge/www/srv/npm-debug.log
npm not ok

I would like to be able to install this program so I can move forward.
I am running Linux.
node is version 0.6.17
npm is version 1.1.21
node-gyp is version 0.5.4
g++ is version 4.3.2
Python is version 2.6

Please let me know if there is any additional information you require, and I will be happy to comply.

Cannot install buffertools on Debian 64bit

Hello,

I am getting the following error when trying to install. Any suggestions ?

CXX(target) Release/obj.target/buffertools/buffertools.o
SOLINK_MODULE(target) Release/obj.target/buffertools.node
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.so when searching for -lstdc++
/usr/bin/ld: skipping incompatible /usr/lib/gcc/x86_64-linux-gnu/4.4.5/libstdc++.a when searching for -lstdc++
/usr/bin/ld: cannot find -lstdc++
collect2: ld returned 1 exit status
make: *** [Release/obj.target/buffertools.node] Error 1

npm install buffertools NOT OK

Hi, I have a problem installing buffertools

$ npm install buffertools

> [email protected] preinstall /home/romain/smartdata/node_modules/buffertools
> ./build-wrapper

Setting srcdir to                        : /home/romain/smartdata/node_modules/buffertools 
Setting blddir to                        : /home/romain/smartdata/node_modules/buffertools/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                   : ok /usr/local/lib/jsctags 
Checking for node prefix                 : ok /usr 
'configure' finished successfully (0.038s)
Waf: Entering directory `/home/romain/smartdata/node_modules/buffertools/build'
[1/2] cxx: buffertools.cc -> build/default/buffertools_1.o
[2/2] cxx_link: build/default/buffertools_1.o -> build/default/buffertools.node
Waf: Leaving directory `/home/romain/smartdata/node_modules/buffertools/build'
'build' finished successfully (0.559s)
Traceback (most recent call last):
  File "./build-wrapper", line 13, in <module>
    prefix = (path for path in ('build/default', 'build/Release') if os.path.isdir(path)).next()
AttributeError: 'generator' object has no attribute 'next'
npm ERR! error installing [email protected] Error: [email protected] preinstall: `./build-wrapper`
npm ERR! error installing [email protected] `sh "-c" "./build-wrapper"` failed with 1
npm ERR! error installing [email protected]     at ChildProcess.<anonymous> (/usr/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] preinstall: `./build-wrapper`
npm ERR! `sh "-c" "./build-wrapper"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] preinstall script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     ./build-wrapper
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.
npm ERR! 
npm ERR! System Linux 3.0-ARCH
npm ERR! command "node" "/usr/bin/npm" "install" "buffertools"
npm ERR! cwd /home/romain/smartdata
npm ERR! node -v v0.4.11
npm ERR! npm -v 1.0.27
npm ERR! 
npm ERR! Additional logging details can be found in:
npm ERR!     /home/romain/smartdata/npm-debug.log
npm not ok

$ npm --version
1.0.27

$ node --version
v0.4.11

$ python --version
Python 3.2.2

Help is welcomed.

Cheers
Romain

Failing build with Node v0.11.11

npm install buffertools
npm http GET https://registry.npmjs.org/buffertools
npm http 200 https://registry.npmjs.org/buffertools
npm http GET https://registry.npmjs.org/buffertools/-/buffertools-2.0.1.tgz
npm http 200 https://registry.npmjs.org/buffertools/-/buffertools-2.0.1.tgz

> [email protected] install /myproject/node_modules/buffertools
> node-gyp rebuild

gmake: Entering directory `/myproject/node_modules/buffertools/build'
  CXX(target) Release/obj.target/buffertools/buffertools.o
In file included from /usr/include/pthread.h:46,
                 from /usr/include/c++/4.2/bits/gthr-default.h:43,
                 from /usr/include/c++/4.2/bits/gthr.h:114,
                 from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/sched.h:230: error: 'pid_t' was not declared in this scope
/usr/include/sched.h:230: error: expected primary-expression before 'struct'
/usr/include/sched.h:230: error: initializer expression list treated as compound expression
/usr/include/sched.h:231: error: 'pid_t' was not declared in this scope
/usr/include/sched.h:232: error: 'pid_t' was not declared in this scope
/usr/include/sched.h:232: error: expected primary-expression before 'struct'
/usr/include/sched.h:232: error: initializer expression list treated as compound expression
/usr/include/sched.h:233: error: 'pid_t' was not declared in this scope
/usr/include/sched.h:233: error: expected primary-expression before 'const'
/usr/include/sched.h:233: error: initializer expression list treated as compound expression
/usr/include/sched.h:234: error: 'pid_t' was not declared in this scope
/usr/include/sched.h:234: error: expected primary-expression before 'int'
/usr/include/sched.h:234: error: expected primary-expression before 'const'
/usr/include/sched.h:234: error: initializer expression list treated as compound expression
In file included from /usr/include/pthread.h:47,
                 from /usr/include/c++/4.2/bits/gthr-default.h:43,
                 from /usr/include/c++/4.2/bits/gthr.h:114,
                 from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/time.h:137: error: 'clock_t' does not name a type
/usr/include/time.h:138: error: expected ',' or '...' before '*' token
/usr/include/time.h:139: error: 'time_t' was not declared in this scope
/usr/include/time.h:139: error: 'time_t' was not declared in this scope
/usr/include/time.h:139: error: initializer expression list treated as compound expression
/usr/include/time.h:141: error: expected ',' or '...' before '*' token
/usr/include/time.h:142: error: expected ',' or '...' before '*' token
/usr/include/time.h:143: error: 'time_t' does not name a type
/usr/include/time.h:146: error: 'time_t' does not name a type
/usr/include/time.h:149: error: 'clockid_t' was not declared in this scope
/usr/include/time.h:149: error: expected primary-expression before 'struct'
/usr/include/time.h:149: error: 'timer_t' was not declared in this scope
/usr/include/time.h:149: error: expected primary-expression before ')' token
/usr/include/time.h:149: error: initializer expression list treated as compound expression
/usr/include/time.h:150: error: 'timer_t' was not declared in this scope
/usr/include/time.h:151: error: 'timer_t' was not declared in this scope
/usr/include/time.h:151: error: expected primary-expression before 'struct'
/usr/include/time.h:151: error: initializer expression list treated as compound expression
/usr/include/time.h:152: error: 'timer_t' was not declared in this scope
/usr/include/time.h:153: error: 'timer_t' was not declared in this scope
/usr/include/time.h:153: error: expected primary-expression before 'int'
/usr/include/time.h:153: error: expected primary-expression before 'const'
/usr/include/time.h:154: error: expected primary-expression before 'struct'
/usr/include/time.h:154: error: initializer expression list treated as compound expression
/usr/include/time.h:161: error: 'clockid_t' was not declared in this scope
/usr/include/time.h:161: error: expected primary-expression before 'struct'
/usr/include/time.h:161: error: initializer expression list treated as compound expression
/usr/include/time.h:162: error: 'clockid_t' was not declared in this scope
/usr/include/time.h:162: error: expected primary-expression before 'struct'
/usr/include/time.h:162: error: initializer expression list treated as compound expression
/usr/include/time.h:163: error: 'clockid_t' was not declared in this scope
/usr/include/time.h:163: error: expected primary-expression before 'const'
/usr/include/time.h:163: error: initializer expression list treated as compound expression
/usr/include/time.h:170: error: expected ',' or '...' before '*' token
/usr/include/time.h:171: error: expected ',' or '...' before '*' token
/usr/include/time.h:172: error: expected ',' or '...' before '*' token
/usr/include/time.h:183: error: 'time_t' does not name a type
/usr/include/time.h:184: error: 'time_t' does not name a type
In file included from /usr/include/c++/4.2/bits/gthr-default.h:43,
                 from /usr/include/c++/4.2/bits/gthr.h:114,
                 from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/pthread.h:147: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:147: error: expected primary-expression before ')' token
/usr/include/pthread.h:148: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:150: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:151: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:152: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:153: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:154: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:154: error: expected primary-expression before ')' token
/usr/include/pthread.h:155: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:155: error: expected primary-expression before ',' token
/usr/include/pthread.h:155: error: expected primary-expression before ')' token
/usr/include/pthread.h:155: error: initializer expression list treated as compound expression
/usr/include/pthread.h:156: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:156: error: expected primary-expression before ',' token
/usr/include/pthread.h:156: error: expected primary-expression before ')' token
/usr/include/pthread.h:156: error: initializer expression list treated as compound expression
/usr/include/pthread.h:157: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:157: error: expected primary-expression before ',' token
/usr/include/pthread.h:157: error: expected primary-expression before 'void'
/usr/include/pthread.h:157: error: expected primary-expression before ')' token
/usr/include/pthread.h:157: error: initializer expression list treated as compound expression
/usr/include/pthread.h:158: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:158: error: expected primary-expression before ',' token
/usr/include/pthread.h:158: error: expected primary-expression before 'void'
/usr/include/pthread.h:158: error: initializer expression list treated as compound expression
/usr/include/pthread.h:159: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:159: error: expected primary-expression before ',' token
/usr/include/pthread.h:159: error: expected primary-expression before 'int'
/usr/include/pthread.h:159: error: initializer expression list treated as compound expression
/usr/include/pthread.h:160: error: 'pthread_barrier_t' was not declared in this scope
/usr/include/pthread.h:160: error: expected primary-expression before ')' token
/usr/include/pthread.h:161: error: 'pthread_barrier_t' was not declared in this scope
/usr/include/pthread.h:161: error: expected primary-expression before ',' token
/usr/include/pthread.h:162: error: expected primary-expression before 'const'
/usr/include/pthread.h:162: error: expected primary-expression before 'unsigned'
/usr/include/pthread.h:162: error: initializer expression list treated as compound expression
/usr/include/pthread.h:163: error: 'pthread_barrier_t' was not declared in this scope
/usr/include/pthread.h:163: error: expected primary-expression before ')' token
/usr/include/pthread.h:164: error: 'pthread_barrierattr_t' was not declared in this scope
/usr/include/pthread.h:164: error: expected primary-expression before ')' token
/usr/include/pthread.h:165: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:167: error: 'pthread_barrierattr_t' was not declared in this scope
/usr/include/pthread.h:167: error: expected primary-expression before ')' token
/usr/include/pthread.h:168: error: 'pthread_barrierattr_t' was not declared in this scope
/usr/include/pthread.h:168: error: expected primary-expression before ',' token
/usr/include/pthread.h:168: error: expected primary-expression before 'int'
/usr/include/pthread.h:168: error: initializer expression list treated as compound expression
/usr/include/pthread.h:182: error: 'pthread_condattr_t' was not declared in this scope
/usr/include/pthread.h:182: error: expected primary-expression before ')' token
/usr/include/pthread.h:183: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:185: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:186: error: 'pthread_condattr_t' was not declared in this scope
/usr/include/pthread.h:186: error: expected primary-expression before ')' token
/usr/include/pthread.h:187: error: 'pthread_condattr_t' was not declared in this scope
/usr/include/pthread.h:187: error: expected primary-expression before ',' token
/usr/include/pthread.h:187: error: 'clockid_t' was not declared in this scope
/usr/include/pthread.h:187: error: initializer expression list treated as compound expression
/usr/include/pthread.h:188: error: 'pthread_condattr_t' was not declared in this scope
/usr/include/pthread.h:188: error: expected primary-expression before ',' token
/usr/include/pthread.h:188: error: expected primary-expression before 'int'
/usr/include/pthread.h:188: error: initializer expression list treated as compound expression
/usr/include/pthread.h:189: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:189: error: expected primary-expression before ')' token
/usr/include/pthread.h:190: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:190: error: expected primary-expression before ')' token
/usr/include/pthread.h:191: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:191: error: expected primary-expression before ',' token
/usr/include/pthread.h:192: error: expected primary-expression before 'const'
/usr/include/pthread.h:192: error: initializer expression list treated as compound expression
/usr/include/pthread.h:193: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:193: error: expected primary-expression before ')' token
/usr/include/pthread.h:194: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:194: error: expected primary-expression before ',' token
/usr/include/pthread.h:195: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:195: error: expected primary-expression before ',' token
/usr/include/pthread.h:195: error: expected primary-expression before 'const'
/usr/include/pthread.h:195: error: initializer expression list treated as compound expression
/usr/include/pthread.h:196: error: 'pthread_cond_t' was not declared in this scope
/usr/include/pthread.h:196: error: expected primary-expression before ',' token
/usr/include/pthread.h:196: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:196: error: expected primary-expression before ')' token
/usr/include/pthread.h:196: error: initializer expression list treated as compound expression
/usr/include/pthread.h:197: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:197: error: expected primary-expression before ',' token
/usr/include/pthread.h:197: error: expected primary-expression before 'const'
/usr/include/pthread.h:198: error: expected primary-expression before 'void'
/usr/include/pthread.h:198: error: expected primary-expression before 'void'
/usr/include/pthread.h:198: error: initializer expression list treated as compound expression
/usr/include/pthread.h:199: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:200: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:200: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:200: error: initializer expression list treated as compound expression
/usr/include/pthread.h:202: error: 'pthread_key_t' was not declared in this scope
/usr/include/pthread.h:203: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:203: error: 'clockid_t' was not declared in this scope
/usr/include/pthread.h:203: error: expected primary-expression before ')' token
/usr/include/pthread.h:203: error: initializer expression list treated as compound expression
/usr/include/pthread.h:204: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:204: error: expected primary-expression before 'void'
/usr/include/pthread.h:204: error: initializer expression list treated as compound expression
/usr/include/pthread.h:205: error: 'pthread_key_t' was not declared in this scope
/usr/include/pthread.h:205: error: expected primary-expression before ',' token
/usr/include/pthread.h:206: error: expected primary-expression before 'void'
/usr/include/pthread.h:206: error: initializer expression list treated as compound expression
/usr/include/pthread.h:207: error: 'pthread_key_t' was not declared in this scope
/usr/include/pthread.h:208: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:208: error: expected primary-expression before ')' token
/usr/include/pthread.h:209: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:209: error: expected primary-expression before ')' token
/usr/include/pthread.h:210: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:212: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:212: error: expected primary-expression before ',' token
/usr/include/pthread.h:212: error: expected primary-expression before 'int'
/usr/include/pthread.h:212: error: initializer expression list treated as compound expression
/usr/include/pthread.h:213: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:213: error: expected primary-expression before ',' token
/usr/include/pthread.h:213: error: expected primary-expression before 'int'
/usr/include/pthread.h:213: error: initializer expression list treated as compound expression
/usr/include/pthread.h:214: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:214: error: expected primary-expression before ',' token
/usr/include/pthread.h:214: error: expected primary-expression before 'int'
/usr/include/pthread.h:214: error: initializer expression list treated as compound expression
/usr/include/pthread.h:215: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:215: error: expected primary-expression before ')' token
/usr/include/pthread.h:216: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:216: error: expected primary-expression before ',' token
/usr/include/pthread.h:217: error: expected primary-expression before 'const'
/usr/include/pthread.h:217: error: initializer expression list treated as compound expression
/usr/include/pthread.h:218: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:218: error: expected primary-expression before ')' token
/usr/include/pthread.h:219: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:219: error: expected primary-expression before ')' token
/usr/include/pthread.h:220: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:220: error: expected primary-expression before ',' token
/usr/include/pthread.h:221: error: expected primary-expression before 'const'
/usr/include/pthread.h:221: error: initializer expression list treated as compound expression
/usr/include/pthread.h:222: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:222: error: expected primary-expression before ')' token
/usr/include/pthread.h:223: error: 'pthread_once_t' was not declared in this scope
/usr/include/pthread.h:223: error: expected primary-expression before ',' token
/usr/include/pthread.h:223: error: expected primary-expression before 'void'
/usr/include/pthread.h:223: error: initializer expression list treated as compound expression
/usr/include/pthread.h:224: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:224: error: expected primary-expression before ')' token
/usr/include/pthread.h:225: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:225: error: expected primary-expression before ',' token
/usr/include/pthread.h:226: error: expected primary-expression before 'const'
/usr/include/pthread.h:226: error: initializer expression list treated as compound expression
/usr/include/pthread.h:227: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:227: error: expected primary-expression before ')' token
/usr/include/pthread.h:228: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:228: error: expected primary-expression before ',' token
/usr/include/pthread.h:229: error: expected primary-expression before 'const'
/usr/include/pthread.h:229: error: initializer expression list treated as compound expression
/usr/include/pthread.h:230: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:230: error: expected primary-expression before ',' token
/usr/include/pthread.h:231: error: expected primary-expression before 'const'
/usr/include/pthread.h:231: error: initializer expression list treated as compound expression
/usr/include/pthread.h:232: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:232: error: expected primary-expression before ')' token
/usr/include/pthread.h:233: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:233: error: expected primary-expression before ')' token
/usr/include/pthread.h:234: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:234: error: expected primary-expression before ')' token
/usr/include/pthread.h:235: error: 'pthread_rwlock_t' was not declared in this scope
/usr/include/pthread.h:235: error: expected primary-expression before ')' token
/usr/include/pthread.h:236: error: 'pthread_rwlockattr_t' was not declared in this scope
/usr/include/pthread.h:236: error: expected primary-expression before ')' token
/usr/include/pthread.h:237: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:239: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:241: error: 'pthread_rwlockattr_t' was not declared in this scope
/usr/include/pthread.h:241: error: expected primary-expression before ')' token
/usr/include/pthread.h:242: error: 'pthread_rwlockattr_t' was not declared in this scope
/usr/include/pthread.h:242: error: expected primary-expression before ',' token
/usr/include/pthread.h:242: error: expected primary-expression before 'int'
/usr/include/pthread.h:242: error: initializer expression list treated as compound expression
/usr/include/pthread.h:243: error: 'pthread_rwlockattr_t' was not declared in this scope
/usr/include/pthread.h:243: error: expected primary-expression before ',' token
/usr/include/pthread.h:243: error: expected primary-expression before 'int'
/usr/include/pthread.h:243: error: initializer expression list treated as compound expression
/usr/include/pthread.h:244: error: 'pthread_t' does not name a type
/usr/include/pthread.h:245: error: 'pthread_key_t' was not declared in this scope
/usr/include/pthread.h:245: error: expected primary-expression before 'const'
/usr/include/pthread.h:245: error: initializer expression list treated as compound expression
/usr/include/pthread.h:247: error: 'pthread_spinlock_t' was not declared in this scope
/usr/include/pthread.h:247: error: expected primary-expression before ',' token
/usr/include/pthread.h:247: error: expected primary-expression before 'int'
/usr/include/pthread.h:247: error: initializer expression list treated as compound expression
/usr/include/pthread.h:248: error: 'pthread_spinlock_t' was not declared in this scope
/usr/include/pthread.h:248: error: expected primary-expression before ')' token
/usr/include/pthread.h:249: error: 'pthread_spinlock_t' was not declared in this scope
/usr/include/pthread.h:249: error: expected primary-expression before ')' token
/usr/include/pthread.h:250: error: 'pthread_spinlock_t' was not declared in this scope
/usr/include/pthread.h:250: error: expected primary-expression before ')' token
/usr/include/pthread.h:251: error: 'pthread_spinlock_t' was not declared in this scope
/usr/include/pthread.h:251: error: expected primary-expression before ')' token
/usr/include/pthread.h:252: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:258: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:259: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:259: error: expected primary-expression before 'int'
/usr/include/pthread.h:259: error: initializer expression list treated as compound expression
/usr/include/pthread.h:263: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:263: error: expected primary-expression before ',' token
/usr/include/pthread.h:264: error: expected primary-expression before 'int'
/usr/include/pthread.h:264: error: initializer expression list treated as compound expression
/usr/include/pthread.h:265: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:265: error: expected primary-expression before ',' token
/usr/include/pthread.h:266: error: expected primary-expression before 'int'
/usr/include/pthread.h:266: error: initializer expression list treated as compound expression
/usr/include/pthread.h:267: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:267: error: expected primary-expression before ',' token
/usr/include/pthread.h:267: error: expected primary-expression before 'int'
/usr/include/pthread.h:267: error: initializer expression list treated as compound expression
/usr/include/pthread.h:268: error: 'pthread_mutex_t' was not declared in this scope
/usr/include/pthread.h:268: error: expected primary-expression before ',' token
/usr/include/pthread.h:268: error: expected primary-expression before 'int'
/usr/include/pthread.h:268: error: expected primary-expression before 'int'
/usr/include/pthread.h:268: error: initializer expression list treated as compound expression
/usr/include/pthread.h:270: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:270: error: expected primary-expression before ',' token
/usr/include/pthread.h:270: error: expected primary-expression before 'int'
/usr/include/pthread.h:270: error: initializer expression list treated as compound expression
/usr/include/pthread.h:271: error: 'pthread_mutexattr_t' was not declared in this scope
/usr/include/pthread.h:271: error: expected primary-expression before ',' token
/usr/include/pthread.h:271: error: expected primary-expression before 'int'
/usr/include/pthread.h:271: error: initializer expression list treated as compound expression
/usr/include/pthread.h:273: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:274: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:276: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:277: error: expected ',' or '...' before '*' token
/usr/include/pthread.h:278: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:278: error: expected primary-expression before ',' token
/usr/include/pthread.h:278: error: expected primary-expression before 'int'
/usr/include/pthread.h:278: error: initializer expression list treated as compound expression
/usr/include/pthread.h:279: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:279: error: expected primary-expression before ',' token
/usr/include/pthread.h:280: error: expected primary-expression before 'const'
/usr/include/pthread.h:280: error: initializer expression list treated as compound expression
/usr/include/pthread.h:281: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:281: error: expected primary-expression before ',' token
/usr/include/pthread.h:281: error: expected primary-expression before 'int'
/usr/include/pthread.h:281: error: initializer expression list treated as compound expression
/usr/include/pthread.h:282: error: 'pthread_attr_t' was not declared in this scope
/usr/include/pthread.h:282: error: expected primary-expression before ',' token
/usr/include/pthread.h:282: error: expected primary-expression before 'int'
/usr/include/pthread.h:282: error: initializer expression list treated as compound expression
/usr/include/pthread.h:283: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:283: error: expected primary-expression before 'int'
/usr/include/pthread.h:284: error: expected primary-expression before 'struct'
/usr/include/pthread.h:284: error: initializer expression list treated as compound expression
/usr/include/pthread.h:285: error: 'pthread_t' was not declared in this scope
/usr/include/pthread.h:285: error: expected primary-expression before 'int'
/usr/include/pthread.h:286: error: expected primary-expression before 'const'
/usr/include/pthread.h:286: error: initializer expression list treated as compound expression
In file included from /usr/include/c++/4.2/bits/gthr-default.h:44,
                 from /usr/include/c++/4.2/bits/gthr.h:114,
                 from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/unistd.h:324: error: 'uid_t' has not been declared
/usr/include/unistd.h:324: error: 'gid_t' has not been declared
/usr/include/unistd.h:335: error: 'pid_t' does not name a type
/usr/include/unistd.h:338: error: 'gid_t' does not name a type
/usr/include/unistd.h:339: error: 'uid_t' does not name a type
/usr/include/unistd.h:340: error: 'gid_t' does not name a type
/usr/include/unistd.h:341: error: 'gid_t' has not been declared
/usr/include/unistd.h:343: error: 'pid_t' does not name a type
/usr/include/unistd.h:344: error: 'pid_t' does not name a type
/usr/include/unistd.h:345: error: 'pid_t' does not name a type
/usr/include/unistd.h:346: error: 'uid_t' does not name a type
/usr/include/unistd.h:358: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:359: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:359: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:359: error: initializer expression list treated as compound expression
/usr/include/unistd.h:360: error: 'pid_t' does not name a type
/usr/include/unistd.h:361: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:364: error: 'pid_t' does not name a type
/usr/include/unistd.h:365: error: 'pid_t' has not been declared
/usr/include/unistd.h:403: error: 'uid_t' has not been declared
/usr/include/unistd.h:403: error: 'gid_t' has not been declared
/usr/include/unistd.h:408: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:409: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:414: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:416: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:417: error: 'uid_t' has not been declared
/usr/include/unistd.h:417: error: 'gid_t' has not been declared
/usr/include/unistd.h:430: error: 'uid_t' has not been declared
/usr/include/unistd.h:430: error: 'gid_t' has not been declared
/usr/include/unistd.h:455: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:455: error: 'pid_t' was not declared in this scope
/usr/include/unistd.h:455: error: initializer expression list treated as compound expression
/usr/include/unistd.h:456: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:456: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:456: error: initializer expression list treated as compound expression
/usr/include/unistd.h:457: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:457: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:457: error: initializer expression list treated as compound expression
/usr/include/unistd.h:479: error: 'useconds_t' does not name a type
/usr/include/unistd.h:481: error: 'useconds_t' was not declared in this scope
/usr/include/unistd.h:482: error: 'pid_t' does not name a type
/usr/include/unistd.h:500: error: 'u_long' was not declared in this scope
/usr/include/unistd.h:502: error: 'gid_t' has not been declared
/usr/include/unistd.h:502: error: 'gid_t' has not been declared
/usr/include/unistd.h:504: error: 'mode_t' does not name a type
/usr/include/unistd.h:506: error: 'uid_t' has not been declared
/usr/include/unistd.h:506: error: 'gid_t' has not been declared
/usr/include/unistd.h:507: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:507: error: expected primary-expression before ',' token
/usr/include/unistd.h:507: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:507: error: expected primary-expression before ',' token
/usr/include/unistd.h:507: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:507: error: expected primary-expression before ')' token
/usr/include/unistd.h:507: error: initializer expression list treated as compound expression
/usr/include/unistd.h:508: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:508: error: expected primary-expression before ',' token
/usr/include/unistd.h:508: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:508: error: expected primary-expression before ',' token
/usr/include/unistd.h:508: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:508: error: expected primary-expression before ')' token
/usr/include/unistd.h:508: error: initializer expression list treated as compound expression
/usr/include/unistd.h:510: error: 'gid_t' has not been declared
/usr/include/unistd.h:521: error: 'mode_t' has not been declared
/usr/include/unistd.h:521: error: 'dev_t' has not been declared
/usr/include/unistd.h:535: error: 'vm_offset_t' has not been declared
/usr/include/unistd.h:545: error: 'pid_t' does not name a type
/usr/include/unistd.h:546: error: 'pid_t' does not name a type
/usr/include/unistd.h:557: error: expected ',' or '...' before '*' token
/usr/include/unistd.h:568: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:568: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:568: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:568: error: initializer expression list treated as compound expression
/usr/include/unistd.h:569: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:569: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:569: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:569: error: initializer expression list treated as compound expression
/usr/include/unistd.h:570: error: 'gid_t' was not declared in this scope
/usr/include/unistd.h:571: error: 'uid_t' was not declared in this scope
/usr/include/unistd.h:573: error: 'u_long' has not been declared
/usr/include/unistd.h:573: error: 'u_long' has not been declared
/usr/include/unistd.h:577: error: 'quad_t' was not declared in this scope
/usr/include/unistd.h:577: error: expected primary-expression before '...' token
/usr/include/unistd.h:577: error: initializer expression list treated as compound expression
In file included from /usr/include/c++/4.2/bits/gthr.h:114,
                 from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/c++/4.2/bits/gthr-default.h:46: error: 'pthread_key_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h:47: error: 'pthread_once_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h:48: error: 'pthread_mutex_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h:49: error: 'pthread_mutex_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h: In function 'int __gthread_active_p()':
/usr/include/c++/4.2/bits/gthr-default.h:173: error: 'pthread_mutex_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h:174: error: 'pthread_once_t' does not name a type
/usr/include/c++/4.2/bits/gthr-default.h:188: error: '__gthread_active_mutex' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:188: error: '__gthrw_pthread_mutex_lock' cannot be used as a function
/usr/include/c++/4.2/bits/gthr-default.h:189: error: '__gthread_active_once' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:189: error: '__gthrw_pthread_once' cannot be used as a function
/usr/include/c++/4.2/bits/gthr-default.h:190: error: '__gthrw_pthread_mutex_unlock' cannot be used as a function
/usr/include/c++/4.2/bits/gthr-default.h: At global scope:
/usr/include/c++/4.2/bits/gthr-default.h:575: error: '__gthread_once' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:575: error: '__gthread_once_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:575: error: 'once' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:575: error: 'func' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:575: error: expected primary-expression before 'void'
/usr/include/c++/4.2/bits/gthr-default.h:575: error: initializer expression list treated as compound expression
/usr/include/c++/4.2/bits/gthr-default.h:576: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:584: error: '__gthread_key_create' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:584: error: '__gthread_key_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:584: error: 'key' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:584: error: 'dtor' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:584: error: expected primary-expression before 'void'
/usr/include/c++/4.2/bits/gthr-default.h:584: error: initializer expression list treated as compound expression
/usr/include/c++/4.2/bits/gthr-default.h:585: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:590: error: '__gthread_key_delete' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:590: error: '__gthread_key_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:591: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:596: error: '__gthread_getspecific' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:596: error: '__gthread_key_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:597: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:602: error: '__gthread_setspecific' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:602: error: '__gthread_key_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:602: error: expected primary-expression before 'const'
/usr/include/c++/4.2/bits/gthr-default.h:602: error: initializer expression list treated as compound expression
/usr/include/c++/4.2/bits/gthr-default.h:603: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:608: error: '__gthread_mutex_lock' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:608: error: '__gthread_mutex_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:608: error: 'mutex' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:609: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:617: error: '__gthread_mutex_trylock' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:617: error: '__gthread_mutex_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:617: error: 'mutex' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:618: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:626: error: '__gthread_mutex_unlock' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:626: error: '__gthread_mutex_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:626: error: 'mutex' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:627: error: expected ',' or ';' before '{' token
/usr/include/c++/4.2/bits/gthr-default.h:636: error: '__gthread_recursive_mutex_init_function' declared as an 'inline' variable
/usr/include/c++/4.2/bits/gthr-default.h:636: error: '__gthread_recursive_mutex_t' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:636: error: 'mutex' was not declared in this scope
/usr/include/c++/4.2/bits/gthr-default.h:637: error: expected ',' or ';' before '{' token
In file included from /usr/include/c++/4.2/bits/c++io.h:43,
                 from /usr/include/c++/4.2/iosfwd:46,
                 from /usr/include/c++/4.2/bits/stl_algobase.h:70,
                 from /usr/include/c++/4.2/algorithm:65,
                 from ../buffertools.cc:21:
/usr/include/c++/4.2/bits/gthr.h:122: error: expected declaration before end of line
gmake: *** [Release/obj.target/buffertools/buffertools.o] Error 1
gmake: Leaving directory `/myproject/node_modules/buffertools/build'
gyp ERR! build error 
gyp ERR! stack Error: `gmake` failed with exit code: 2
gyp ERR! stack     at ChildProcess.onExit (/usr/local/lib/node_modules/node-gyp/lib/build.js:267:23)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:107:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:879:12)
gyp ERR! System FreeBSD 9.1-RELEASE
gyp ERR! command "node" "/usr/local/bin/node-gyp" "rebuild"
gyp ERR! cwd /myproject/node_modules/buffertools
gyp ERR! node -v v0.11.11
gyp ERR! node-gyp -v v0.12.1
gyp ERR! not ok 
npm ERR! weird error 1
npm ERR! not ok code 0

Failed at the [email protected] install script (Windows Azure)

I do not use node-buffertools directly, it seems other packages depend on it (https://github.com/rvagg/node-levelup for example). npm install gives this:
(windowsazure.com, default PaaS)

npm ERR! [email protected] install: `node-gyp rebuild`
npm ERR! `cmd "/c" "node-gyp rebuild"` failed with 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is most likely a problem with the buffertools package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR!     node-gyp rebuild
npm ERR! You can get their info via:
npm ERR!     npm owner ls buffertools
npm ERR! There is likely additional logging output above.

npm ERR! System Windows_NT 6.1.7601
npm ERR! command "D:\\Program Files (x86)\\nodejs\\\\node.exe" "D:\\Program Files (x86)\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "install" "--production"
npm ERR! cwd C:\DWASFiles\Sites\share-a-tab\VirtualDirectory0\site\wwwroot
npm ERR! node -v v0.6.20
npm ERR! npm -v 1.1.37
npm ERR! code ELIFECYCLE
npm ERR! message [email protected] install: `node-gyp rebuild`
npm ERR! message `cmd "/c" "node-gyp rebuild"` failed with 1
npmSetConsoleTitleW: The operation completed successfully.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.