Doesn't work under Node.js 6.0.0
See original GitHub issueIf we take the example on the main page:
var pg = require('pg');
var conString = "postgres://username:password@localhost/database";
//this initializes a connection pool
//it will keep idle connections open for a (configurable) 30 seconds
//and set a limit of 10 (also configurable)
pg.connect(conString, function(err, client, done) {
if(err) {
return console.error('error fetching client from pool', err);
}
client.query('SELECT $1::int AS number', ['1'], function(err, result) {
//call `done()` to release the client back to the pool
done();
if(err) {
return console.error('error running query', err);
}
console.log(result.rows[0].number);
//output: 1
});
});
And simply switch to Node.js 6.0.0, we are immediately getting an error:
error fetching client from pool { error: password authentication failed for user "postgres"
at Connection.parseE (D:\NodeJS\tests\node_modules\pg\lib\connection.js:539:11)
at Connection.parseMessage (D:\NodeJS\tests\node_modules\pg\lib\connection.js:366:17)
at Socket.<anonymous> (D:\NodeJS\tests\node_modules\pg\lib\connection.js:105:22)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at readableAddChunk (_stream_readable.js:172:18)
at Socket.Readable.push (_stream_readable.js:130:10)
at TCP.onread (net.js:535:20)
name: 'error',
length: 115,
severity: 'FATAL',
code: '28P01',
detail: undefined,
hint: undefined,
position: undefined,
internalPosition: undefined,
internalQuery: undefined,
where: undefined,
schema: undefined,
table: undefined,
column: undefined,
dataType: undefined,
constraint: undefined,
file: 'src\\backend\\libpq\\auth.c',
line: '304',
routine: 'auth_failed' }
i.e. authentication doesn’t work under the newly released Node.js 6.0.0
My Test environment:
- Windows 10, 64-bit
- Node.js 6.0.0 (released)
Issue Analytics
- State:
- Created 7 years ago
- Reactions:27
- Comments:31 (13 by maintainers)
Top Results From Across the Web
Node inspector doesn't work with Node 6.0.0 - Stack Overflow
I've updated my project to Node 6.0.0 from 4.2.2. I figured out node-inspector won't work and causes "Internal error: illegal access" in console ......
Read more >How to fix 'npm does not support Node.js v14' error on ...
My first attempt was updating over the top of my existing node.js installation. I then tried uninstalling node.js installation (Windows Add/ ...
Read more >Node Tool Installer doesn't install proper NPM version
The official installer from https://nodejs.org/ installs NPM 6.0.0 with Node.js 10.0.0. The Node Tool Installer installs NPM 5.6.0 with Node.js 10.0.0.
Read more >ts-node - npm
TypeScript execution environment and REPL for node.js, with source ... ts-node does not eagerly load files , include or exclude by default.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Hello everyone,
Here’s what fixes the Node v6.0.0 problem:
https://github.com/ignitenet-martynas/node-postgres/commit/77560fe1bbc80ba0a629720161d81dbb6286166d
The issue has been resolved with 4.5.5 release.
Thank you @ignitenet-martynas and @brianc 👍