question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Doesn't work under Node.js 6.0.0

See original GitHub issue

If 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:closed
  • Created 7 years ago
  • Reactions:27
  • Comments:31 (13 by maintainers)

github_iconTop GitHub Comments

17reactions
ignitenet-martynascommented, Apr 27, 2016
8reactions
vitaly-tcommented, Apr 27, 2016

The issue has been resolved with 4.5.5 release.

Thank you @ignitenet-martynas and @brianc 👍

Read more comments on GitHub >

github_iconTop Results From Across the Web

Node v0.6.0
Node.js® is a JavaScript runtime built on Chrome's V8 JavaScript engine.
Read more >
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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found