Cannot initialize connector "postgresql": Promise is not defined

182 views
Skip to first unread message

Daren Arnold

unread,
Aug 17, 2016, 8:51:46 AM8/17/16
to LoopbackJS
I am recently seeing the following error when I attempt to invoke my application.  I assumed the issue was caused by something being upgraded, but I have upgraded everything and still receive the error:

/adg-src/adg-repo/node_modules/loopback/lib/application.js:245
    throw err;
          ^
ReferenceError: Cannot create data source "adgPostgres": Cannot initialize connector "postgresql": Promise is not defined
    at module.exports (/adg-src/adg-repo/node_modules/pg-pool/index.js:14:42)
    at new BoundPool (/adg-src/adg-repo/node_modules/pg/lib/pool-factory.js:12:10)
    at new PostgreSQL (/adg-src/adg-repo/node_modules/loopback-connector-postgresql/lib/postgresql.js:79:13)
    at Object.initializeDataSource [as initialize] (/adg-src/adg-repo/node_modules/loopback-connector-postgresql/lib/postgresql.js:34:26)
    at DataSource.setup (/adg-src/adg-repo/node_modules/loopback-datasource-juggler/lib/datasource.js:339:19)
    at new DataSource (/adg-src/adg-repo/node_modules/loopback-datasource-juggler/lib/datasource.js:117:8)
    at Registry.createDataSource (/adg-src/adg-repo/node_modules/loopback/lib/registry.js:355:12)
    at dataSourcesFromConfig (/adg-src/adg-repo/node_modules/loopback/lib/application.js:437:19)
    at EventEmitter.app.dataSource (/adg-src/adg-repo/node_modules/loopback/lib/application.js:235:14)
    at /adg-src/adg-repo/node_modules/loopback-boot/lib/executor.js:188:9

I am at a loss for what is going on.  There aren't any references to this specific error that I have been able to find via Google.

Here is the npm list of all versions:

root@eb0136ae638f:/adg-src/adg-repo# npm list
a...@1.0.0 /adg-src/adg-repo
+-- cldr...@29.0.1
| +-- cldr-data-...@0.2.5
| | +-- adm...@0.4.4
| | +-- mkd...@0.5.0
| | | `-- mini...@0.0.8
| | +-- no...@3.0.6
| | | `-- abb...@1.0.9
| | +-- npm...@2.0.9
| | | +-- config...@1.1.10
| | | | `-- proto...@1.2.4
| | | +-- i...@1.3.4
| | | +-- os...@0.1.3
| | | | `-- os-t...@1.0.1
| | | `-- uid-n...@0.0.5
| | +-- prog...@1.1.8
| | +-- q...@1.0.1
| | +-- req...@2.74.0
| | | +-- aws-...@0.6.0
| | | +-- aw...@1.4.1
| | | +-- b...@1.1.2
| | | +-- case...@0.11.0
| | | +-- combine...@1.0.5
| | | | `-- delayed...@1.0.0
| | | +-- ext...@3.0.0
| | | +-- foreve...@0.6.1
| | | +-- form...@1.0.0-rc4
| | | | `-- as...@1.5.2
| | | +-- har-va...@2.0.6
| | | | +-- comm...@2.9.0
| | | | | `-- graceful...@1.0.1
| | | | `-- pinkie-...@2.0.1
| | | |   `-- pin...@2.0.4
| | | +-- ha...@3.1.3
| | | | +-- bo...@2.10.1
| | | | +-- cryp...@2.0.5
| | | | +-- ho...@2.16.3
| | | | `-- sn...@1.0.9
| | | +-- http-si...@1.1.1
| | | | +-- asser...@0.2.0
| | | | +-- jsp...@1.3.0
| | | | | +-- extsp...@1.0.2
| | | | | +-- json-...@0.2.2
| | | | | `-- ver...@1.3.6
| | | | `-- ss...@1.9.2
| | | |   +-- as...@0.2.3
| | | |   +-- asser...@1.0.0
| | | |   +-- dash...@1.14.0
| | | |   | `-- asser...@1.0.0
| | | |   +-- ecc-...@0.1.1
| | | |   +-- get...@0.1.6
| | | |   | `-- asser...@1.0.0
| | | |   +-- jodid...@1.0.2
| | | |   +-- js...@0.1.0
| | | |   `-- twee...@0.13.3
| | | +-- is-typ...@1.0.0
| | | +-- isst...@0.1.2
| | | +-- json-stri...@5.0.1
| | | +-- oauth...@0.8.2
| | | +-- string...@0.0.5
| | | +-- tough-...@2.3.1
| | | `-- tunnel...@0.4.3
| | `-- request-...@0.3.1
| |   `-- throt...@0.0.2
| `-- gl...@5.0.15
|   +-- infl...@1.0.5
|   | `-- wra...@1.0.2
|   +-- inhe...@2.0.1
|   +-- mini...@3.0.3
|   +-- on...@1.3.3
|   `-- path-is-...@1.0.0
+-- compr...@1.6.2
| +-- acc...@1.3.3
| | +-- mime-...@2.1.11
| | `-- negot...@0.6.1
| +-- by...@2.3.0
| +-- compre...@2.0.8
| | `-- mim...@1.23.0
| +-- de...@2.2.0
| +-- on-he...@1.0.1
| `-- va...@1.1.0
+-- co...@2.7.1
+-- errorh...@1.4.3
| `-- escap...@1.0.3
+-- jsh...@2.9.2
| +-- c...@0.6.6
| | `-- gl...@3.2.11
| |   `-- mini...@0.3.0
| |     +-- lru-...@2.7.3
| |     `-- sig...@1.0.1
| +-- console-b...@1.1.0
| | `-- date...@0.1.4
| +-- ex...@0.1.2
| +-- htmlp...@3.8.3
| | +-- domelem...@1.3.0
| | +-- domha...@2.3.0
| | +-- domu...@1.5.1
| | | `-- dom-ser...@0.1.0
| | |   `-- domelem...@1.1.3
| | +-- enti...@1.0.0
| | `-- readabl...@1.1.14
| |   +-- core-u...@1.0.2
| |   +-- isa...@0.0.1
| |   `-- string_...@0.10.31
| +-- lod...@3.7.0
| +-- mini...@2.0.10
| | `-- brace-e...@1.1.6
| |   +-- balance...@0.4.2
| |   `-- conca...@0.0.1
| +-- she...@0.3.0
| `-- strip-jso...@1.0.4
+-- loop...@2.30.0
| +-- as...@2.0.1
| | `-- lod...@4.15.0
| +-- bcry...@2.3.0
| +-- body-...@1.15.2
| | +-- by...@2.4.0
| | +-- conten...@1.0.2
| | +-- http-...@1.5.0
| | | +-- setprot...@1.0.1
| | | `-- stat...@1.3.0
| | +-- iconv...@0.4.13
| | +-- on-fi...@2.3.0
| | | `-- ee-f...@1.1.1
| | +-- q...@6.2.0
| | +-- raw-...@2.1.7
| | | +-- by...@2.4.0
| | | `-- unp...@1.0.0
| | `-- typ...@1.6.13
| |   `-- media...@0.3.0
| +-- canonic...@0.0.4
| +-- cookie...@1.4.3
| | +-- coo...@0.3.1
| | `-- cookie-s...@1.0.6
| +-- de...@1.1.0
| +-- e...@2.5.1
| +-- exp...@4.14.0
| | +-- array-...@1.1.1
| | +-- content-d...@0.5.1
| | +-- enco...@1.0.1
| | +-- finalh...@0.5.0
| | +-- merge-de...@1.0.1
| | +-- met...@1.1.2
| | +-- path-to...@0.1.7
| | +-- proxy...@1.1.2
| | | +-- forw...@0.1.0
| | | `-- ipad...@1.1.1
| | +-- range-...@1.2.0
| | +-- se...@0.14.1
| | | +-- des...@1.0.4
| | | `-- mi...@1.3.4
| | +-- serve-...@1.11.1
| | `-- utils...@1.0.0
| +-- infle...@1.10.0
| +-- loopback-con...@1.3.1
| +-- loopback...@1.0.0
| | `-- continuation-...@3.1.7
| |   +-- async-l...@0.6.3
| |   | `-- shi...@1.0.0
| |   `-- emitter-...@1.0.1
| +-- loopbac...@1.3.1
| | `-- as...@0.9.2
| +-- nodem...@2.5.0
| | +-- lib...@2.0.3
| | | +-- libb...@0.1.0
| | | `-- li...@1.1.0
| | +-- mailco...@3.10.0
| | | `-- buil...@3.8.0
| | |   `-- addres...@1.0.1
| | +-- nodemailer-di...@3.2.0
| | | `-- smtp-co...@2.8.0
| | |   `-- http...@1.6.1
| | |     +-- htt...@0.4.22
| | |     `-- under...@1.7.0
| | +-- nodemail...@1.0.5
| | | `-- nodemail...@1.4.0
| | +-- nodemailer...@2.7.0
| | | `-- nodemailer...@0.1.10
| | +-- nodemailer-s...@2.6.0
| | `-- so...@1.1.9
| |   +-- i...@1.1.3
| |   `-- smart-...@1.0.11
| +-- nodemailer-s...@1.0.0
| +-- sta...@0.1.5
| +-- strong-g...@2.6.7
| | +-- as...@1.5.2
| | +-- esp...@2.7.2
| | +-- estra...@4.2.0
| | +-- fs-...@1.0.2
| | | +-- gl...@4.5.3
| | | | `-- mini...@2.0.10
| | | +-- iconv...@0.2.11
| | | +-- mkd...@0.3.5
| | | `-- rim...@2.5.4
| | +-- g11n-p...@1.2.3
| | | `-- swagger...@2.1.18
| | |   +-- bt...@1.1.2
| | |   +-- cook...@2.1.0
| | |   +-- lodash...@3.10.2
| | |   +-- q...@1.4.1
| | |   `-- super...@1.8.4
| | |     +-- componen...@1.2.1
| | |     +-- cook...@2.0.6
| | |     +-- form...@1.0.0-rc3
| | |     | `-- as...@1.5.2
| | |     +-- formi...@1.0.17
| | |     +-- q...@2.3.3
| | |     +-- readabl...@1.0.27-1
| | |     | `-- isa...@0.0.1
| | |     `-- reduce-c...@1.0.1
| | +-- glob...@1.1.1
| | | `-- cld...@0.4.4
| | +-- htmlp...@3.9.1
| | | +-- enti...@1.1.1
| | | `-- readabl...@2.0.6
| | |   `-- process-ne...@1.0.7
| | +-- m...@2.1.0
| | | +-- cha...@0.0.1
| | | +-- cr...@0.0.1
| | | `-- is-b...@1.1.4
| | +-- mkd...@0.5.1
| | +-- mktm...@0.1.1
| | | `-- rim...@2.2.8
| | +-- opti...@0.1.3
| | +-- os-l...@1.4.0
| | | `-- lc...@1.0.0
| | |   `-- inve...@1.0.0
| | +-- posix-...@1.2.0
| | +-- word-...@0.2.2
| | +-- xt...@4.0.1
| | `-- yam...@0.2.8
| |   `-- argp...@1.0.7
| +-- strong-...@2.29.0
| | +-- as...@0.9.2
| | +-- evente...@0.4.14
| | +-- jay...@1.2.2
| | | +-- comm...@1.3.2
| | | | `-- keyp...@0.1.0
| | | +-- ey...@0.1.8
| | | +-- JSONS...@1.0.3
| | | | `-- json...@1.0.0
| | | `-- lod...@3.6.0
| | +-- js2xml...@0.1.9
| | +-- mux-...@3.7.9
| | | +-- dup...@1.0.0
| | | +-- json-...@2.0.11
| | | +-- msgpack...@0.0.12
| | | | +-- bo...@0.0.6
| | | | | +-- base...@0.0.2
| | | | | `-- to-...@0.0.1
| | | | +-- msgpa...@0.3.0
| | | | `-- thr...@2.3.4
| | | +-- stream-...@0.0.2
| | | | `-- dupl...@0.0.4
| | | +-- stream-s...@1.1.2
| | | +-- thr...@2.3.8
| | | `-- xt...@1.0.3
| | +-- q...@2.4.2
| | +-- s...@0.0.6
| | | `-- opt...@0.0.6
| | `-- xml...@0.4.17
| |   +-- s...@1.2.1
| |   `-- xmlbu...@4.2.1
| +-- ui...@0.0.3
| `-- undersco...@3.3.4
|   +-- sprin...@1.0.3
|   `-- util-de...@1.0.2
+-- loopba...@2.21.0
| +-- as...@0.9.2
| +-- comm...@0.0.1
| +-- lod...@3.10.1
| +-- sem...@4.3.6
| `-- topo...@0.2.12
+-- loopback-conne...@2.6.3
| +-- as...@0.9.2
| +-- loopback-...@2.4.0
| | `-- as...@1.5.2
| `-- p...@6.1.0
|   +-- buffer...@1.0.1
|   +-- packet...@0.2.0
|   +-- pg-connect...@0.1.3
|   +-- pg-...@1.4.0
|   | +-- generi...@2.4.2
|   | `-- object...@4.1.0
|   +-- pg-t...@1.11.0
|   | +-- a...@0.2.0
|   | +-- postgre...@1.0.0
|   | +-- postgre...@1.0.0
|   | +-- postgr...@1.0.3
|   | `-- postgres...@1.0.2
|   +-- pgp...@1.0.1
|   | `-- sp...@1.0.0
|   `-- sem...@4.3.2
+-- loopback-data...@2.49.0
| +-- as...@1.0.0
| +-- esl...@2.13.1
| | +-- ch...@1.1.3
| | | +-- ansi-...@2.2.1
| | | +-- escape-str...@1.0.5
| | | +-- has-...@2.0.0
| | | +-- strip...@3.0.1
| | | `-- support...@2.0.0
| | +-- concat...@1.5.1
| | | `-- typed...@0.0.6
| | +-- doct...@1.2.2
| | | +-- esu...@1.1.6
| | | `-- isa...@1.0.0
| | +-- es6...@0.1.4
| | | +-- d...@0.1.1
| | | +-- es5...@0.10.12
| | | +-- es6-it...@2.0.0
| | | +-- es6...@0.1.4
| | | +-- es6-s...@3.1.0
| | | `-- event-...@0.3.4
| | +-- esc...@3.6.0
| | | +-- es6-we...@2.0.1
| | | `-- esre...@4.1.0
| | |   `-- estra...@4.1.1
| | +-- esp...@3.1.7
| | | +-- ac...@3.3.0
| | | `-- acor...@3.0.1
| | +-- esu...@2.0.2
| | +-- file-ent...@1.3.1
| | | `-- flat-...@1.2.1
| | |   +-- circul...@0.3.1
| | |   +-- d...@2.2.2
| | |   | +-- glo...@5.0.0
| | |   | | +-- array...@1.0.2
| | |   | | | `-- array...@1.0.3
| | |   | | `-- arr...@1.0.1
| | |   | +-- is-pa...@1.0.0
| | |   | +-- is-path...@1.0.0
| | |   | | `-- is-path...@1.0.0
| | |   | `-- pi...@2.3.0
| | |   +-- grace...@4.1.5
| | |   `-- wr...@0.2.1
| | +-- gl...@7.0.5
| | | `-- fs.re...@1.0.0
| | +-- glo...@9.9.0
| | +-- ign...@3.1.5
| | +-- imurm...@0.1.4
| | +-- inqu...@0.12.0
| | | +-- ansi-e...@1.4.0
| | | +-- ansi-...@2.0.0
| | | +-- cli-c...@1.0.2
| | | | `-- restore...@1.0.1
| | | |   +-- exit...@1.1.1
| | | |   `-- one...@1.1.0
| | | +-- cli-...@2.1.0
| | | +-- fig...@1.7.0
| | | +-- read...@1.0.1
| | | | +-- code-p...@1.0.0
| | | | | `-- number...@1.0.0
| | | | +-- is-fullwidt...@1.0.0
| | | | `-- mute-...@0.0.5
| | | +-- run-...@0.1.0
| | | +-- rx-...@3.1.2
| | | `-- string...@1.0.2
| | +-- is-my-js...@2.13.1
| | | +-- generate...@2.0.0
| | | +-- generate-obj...@1.2.0
| | | | `-- is-pr...@1.0.2
| | | `-- jsonp...@2.0.0
| | +-- is-res...@1.0.0
| | | `-- tr...@1.0.2
| | +-- js-...@3.6.1
| | +-- json-stabl...@1.0.1
| | | `-- jso...@0.0.0
| | +-- le...@0.3.0
| | | +-- prelu...@1.1.2
| | | `-- type-...@0.3.2
| | +-- optio...@0.8.1
| | | +-- dee...@0.1.3
| | | +-- fast-lev...@1.1.4
| | | `-- word...@1.0.0
| | +-- path-is...@1.0.1
| | +-- plur...@1.2.1
| | +-- require-...@1.0.2
| | | +-- calle...@0.1.0
| | | | `-- call...@0.2.0
| | | `-- resolv...@1.0.1
| | +-- she...@0.6.1
| | +-- ta...@3.7.8
| | | +-- blue...@3.4.1
| | | +-- slice...@0.0.4
| | | +-- t...@1.2.7
| | | `-- xre...@3.1.1
| | +-- text-...@0.2.0
| | `-- user...@2.0.0
| |   `-- os-ho...@1.0.1
| +-- node...@1.4.7
| +-- q...@3.1.0
| `-- trav...@0.6.6
+-- loopback...@1.8.0
| +-- de...@1.0.4
| | `-- m...@0.6.2
| +-- exp...@3.21.2
| | +-- basic...@1.0.4
| | +-- comm...@2.6.0
| | +-- con...@2.30.2
| | | +-- basic-aut...@1.0.0
| | | +-- body-...@1.13.3
| | | | `-- iconv...@0.4.11
| | | +-- by...@2.1.0
| | | +-- compr...@1.5.2
| | | | +-- acc...@1.2.13
| | | | | `-- negot...@0.5.3
| | | | `-- va...@1.0.1
| | | +-- connect...@1.6.2
| | | | `-- http-...@1.3.1
| | | +-- coo...@0.1.3
| | | +-- cookie...@1.3.5
| | | +-- cs...@1.8.3
| | | | +-- coo...@0.1.3
| | | | +-- cs...@3.0.3
| | | | | +-- base6...@1.2.2
| | | | | +-- rn...@1.2.0
| | | | | +-- tss...@1.0.5
| | | | | `-- uid-...@2.1.1
| | | | |   `-- random...@1.0.0
| | | | `-- http-...@1.3.1
| | | +-- de...@1.0.1
| | | +-- express...@1.11.3
| | | | +-- coo...@0.1.3
| | | | +-- c...@3.3.0
| | | | +-- de...@1.0.1
| | | | `-- uid-...@2.0.0
| | | |   `-- base6...@1.2.1
| | | +-- finalh...@0.4.0
| | | | `-- escap...@1.0.2
| | | +-- http-...@1.3.1
| | | +-- method-...@2.3.6
| | | +-- mor...@1.6.1
| | | | `-- de...@1.0.1
| | | +-- multi...@3.3.2
| | | | +-- readabl...@1.1.14
| | | | | `-- isa...@0.0.1
| | | | `-- stream-...@0.2.0
| | | |   `-- readabl...@1.1.14
| | | |     `-- isa...@0.0.1
| | | +-- pa...@0.1.0
| | | +-- q...@4.0.0
| | | +-- respon...@2.3.1
| | | | `-- de...@1.0.1
| | | +-- serve...@1.7.3
| | | | +-- acc...@1.2.13
| | | | | `-- negot...@0.5.3
| | | | +-- ba...@0.5.3
| | | | `-- http-...@1.3.1
| | | +-- serve-...@1.10.3
| | | | +-- escap...@1.0.3
| | | | `-- se...@0.13.2
| | | |   +-- de...@1.1.0
| | | |   +-- escap...@1.0.3
| | | |   +-- range-...@1.0.3
| | | |   `-- stat...@1.2.1
| | | `-- vh...@3.0.2
| | +-- content-d...@0.5.0
| | +-- coo...@0.1.3
| | +-- de...@2.2.0
| | | `-- m...@0.7.1
| | +-- de...@1.0.1
| | +-- escap...@1.0.2
| | +-- merge-de...@1.0.0
| | +-- proxy...@1.0.10
| | | `-- ipad...@1.0.5
| | +-- range-...@1.0.3
| | +-- se...@0.13.0
| | | +-- de...@2.2.0
| | | +-- des...@1.0.3
| | | +-- http-...@1.3.1
| | | +-- m...@0.7.1
| | | `-- stat...@1.2.1
| | `-- va...@1.0.1
| +-- lod...@2.4.2
| `-- swagg...@2.0.24
|   +-- coffee...@1.6.3
|   +-- handl...@1.0.12
|   | +-- opti...@0.3.7
|   | | `-- word...@0.0.3
|   | `-- ugli...@2.3.6
|   |   +-- as...@0.2.10
|   |   `-- sourc...@0.1.43
|   |     `-- amde...@1.0.0
|   +-- le...@1.4.2
|   | +-- mi...@1.2.11
|   | +-- mkd...@0.3.5
|   | `-- ycs...@1.0.1
|   `-- swagger...@2.0.36
|     +-- bt...@1.1.1
|     `-- sh...@0.8.10
|       +-- a...@0.1.8
|       +-- cook...@1.3.1
|       `-- spr...@0.1.1
`-- serve-...@2.3.0
  +-- et...@1.7.0
  +-- fr...@0.3.0
  +-- m...@0.7.1
  `-- pars...@1.3.1

Heath Morrison

unread,
Aug 17, 2016, 9:26:38 AM8/17/16
to LoopbackJS
Hi Daren,

It sounds like you're using a version of Node that lacks native promises and which is no longer supported by this module. IMHO should upgrade node to at least v4.x. If that is not possible, read this doc about using Bluebird to get promise support on earlier versions of node: https://docs.strongloop.com/display/public/LB/Using+promises


--
You received this message because you are subscribed to the Google Groups "LoopbackJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to loopbackjs+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/loopbackjs/e64490df-d541-4d9e-a9af-16c7707de153%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
Message has been deleted
0 new messages