pg.connect not a function?

后端 未结 4 1774
梦谈多话
梦谈多话 2021-01-17 07:59

There appears to be a lot of documentation (e.g. https://devcenter.heroku.com/articles/heroku-postgresql#connecting-in-node-js, but also elsewhere including this site) indic

4条回答
  •  清歌不尽
    2021-01-17 08:36

    If you want to stick with the code you have you can use an older version of Postgres.

    First, apply:

    npm uninstall postgresql
    

    and then install version 6.1.2 (which is compatible with the code you mentioned):

    npm install pg@6.1.2
    

提交回复
热议问题