Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

node-httpreq exception #2

Closed
CuthbertJungle opened this issue Mar 10, 2013 · 1 comment
Closed

node-httpreq exception #2

CuthbertJungle opened this issue Mar 10, 2013 · 1 comment

Comments

@CuthbertJungle
Copy link

        var responsebody = Buffer.concat(chunks);
                         ^

TypeError: Object function Buffer(subject, encoding, offset) {
if (!(this instanceof Buffer)) {
return new Buffer(subject, encoding, offset);
}

var type;

// Are we slicing?
if (typeof offset === 'number') {
this.length = coerce(encoding);
this.parent = subject;
this.offset = offset;
} else {
// Find the length
switch (type = typeof subject) {
case 'number':
this.length = coerce(subject);
break;

  case 'string':
    this.length = Buffer.byteLength(subject, encoding);
    break;

  case 'object': // Assume object is an array
    this.length = coerce(subject.length);
    break;

  default:
    throw new Error('First argument needs to be a number, ' +
                    'array or string.');
}

if (this.length > Buffer.poolSize) {
  // Big buffer, just alloc one.
  this.parent = new SlowBuffer(this.length);
  this.offset = 0;

} else {
  // Small buffer.
  if (!pool || pool.length - pool.used < this.length) allocPool();
  this.parent = pool;
  this.offset = pool.used;
  pool.used += this.length;
}

// Treat array-ish objects as a byte array.
if (isArrayIsh(subject)) {
  for (var i = 0; i < this.length; i++) {
    this.parent[i + this.offset] = subject[i];
  }
} else if (type == 'string') {
  // We are a string
  this.length = this.write(subject, 0, encoding);
}

}

SlowBuffer.makeFastBuffer(this.parent, this, this.offset, this.length);
} has no method 'concat'
at IncomingMessage. (C:\Documents and Settings\david wilson\WebstormProjects\angular-socket-io\node_modules\httpreq\httpreq.js:125:30)
at IncomingMessage.emit (events.js:88:20)
at HTTPParser.parserOnMessageComplete as onMessageComplete
at Socket.socketOnData as ondata
at TCP.onread (net.js:374:27)

@SamDecrock
Copy link
Owner

Buffer has no method 'concat'

I think you need to update your node.js . It should be at least node 0.8.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants