pg-native error
See original GitHub issueWhen I run my project where I do import pg from 'pg';
I got the following error:
Cannot find module 'pg-native'
Require stack:
Does anybody know how to fix it? I use the latest version of the node-postgres
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:5
Top Results From Across the Web
webpack import error with node-postgres ('pg'.Client)
The error above was thrown when attempting to run a Cypress test that required the npm package 'pg'. Attempting to install the pg-native...
Read more >pg-native - npm
A slightly nicer interface to Postgres over node-libpq. Latest version: 3.0.1, last published: 4 months ago. Start using pg-native in your ...
Read more >serverless/serverless - Gitter
If you look at the pg code, it attempts to require pg-native and fails if it's not there. not fails, ignores. BUT, jaws...
Read more >Solved: pg-native could not be resolved - Shopify Community
... although I'm still getting errors on creating the web pixel ... We spent a good chunk of time trying to fix the...
Read more >Unable to publish function using postgres - Build Plugins
Unable to deploy this: postgres function If I remove pg dependencies, it works: "pg": "^7.4.1", "pg-native": "^2.2.0", I also try to run it...
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
I was able to work around this (using pools in my particular case) by using:
and installing the types using:
npm i @types/pg-pool
. Good enough for now, if not ideal.My imports are like so:
Used it like so: