Search code examples
node.jspg

erreur with pg module: undefined Promise


Im begginer with node.js. i work with old project and i have problem with pg module. PS: the pg was delete and when and re-install. enter image description here


Solution

  • What's your version of node ? If you use node v6 all should work correct. Try to install this module and do next

    var promise = require('promise');
    var pg = require('pg');
    
    var pool = new pg.Pool({
        // your connection settings
        Promise: promise
    });
    

    It should work.