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

Calling Buffer as function is deprecated #1214

Closed
adrianhelvik opened this issue Feb 11, 2017 · 1 comment
Closed

Calling Buffer as function is deprecated #1214

adrianhelvik opened this issue Feb 11, 2017 · 1 comment

Comments

@adrianhelvik
Copy link

adrianhelvik commented Feb 11, 2017

❯ node --trace-deprecation -e 'require("pg")'
(node:50727) DeprecationWarning: Using Buffer without `new` will soon stop working. Use `new Buffer()`, or preferably `Buffer.from()`, `Buffer.allocUnsafe()` or `Buffer.alloc()` instead.
    at Buffer (buffer.js:79:13)
    at Object.<anonymous> (/path/to/project/node_modules/pg/lib/connection.js:299:19)
    at Module._compile (module.js:571:32)
    at Object.Module._extensions..js (module.js:580:10)
    at Module.load (module.js:488:32)
    at tryModuleLoad (module.js:447:12)
    at Function.Module._load (module.js:439:3)
    at Module.require (module.js:498:17)
    at require (internal/module.js:20:19)
    at Object.<anonymous> (/path/to/project/node_modules/pg/lib/client.js:18:18)

The problem is on line 299 of lib/connection.js

var emptyBuffer = Buffer(0);
@charmander
Copy link
Collaborator

Upgrade to Node 7.2.1 or later; see #1198, #1195, #1189, #1163, and #1158.

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

No branches or pull requests

2 participants