Closed abdusamadtv closed 3 years ago
The error message tells you the problem: namely, that you depend on pg v8, but the version of knex you're using requires pg 7. This means your dependency graph is invalid.
You need to either downgrade pg to v7, or upgrade knex to a version that peerDepends on pg v8.
The error message tells you the problem: namely, that you depend on pg v8, but the version of knex you're using requires pg 7. This means your dependency graph is invalid.
You need to either downgrade pg to v7, or upgrade knex to a version that peerDepends on pg v8.
Then why does everything work when I switch to Node.js v14.16.1
and npm v6.14.12
?
It doesn't actually work - it's just that npm 6 doesn't tell you during installs that your dep graph is invalid. Run npm ls
, and you'll see it exit nonzero.
When your dep graph is invalid, things might work, but you can't rely on that.
Same problem for me.
I have faced the same issue. As a quick fix, I had to downgrade to npm version 6.
Other solution would be to use '--legacy-peer-deps' flag.
The proper fix is to make your dep graph valid. Downgrading to npm 6, or using the legacy flag, just hides that your program (not npm) is broken.
If the peer dep error message isn’t clear to anyone, please post it - I’m happy to decipher it.
@abdusamadtv does fixing the invalid combo with pg
help?
As @ljharb has noted, you must resolve the conflict in your peer dependencies to resolve this problem; There's options to work around this (ie. --force
or --legacy-peer-deps
) as well.
Current Behavior:
Getting
ERESOLVE unable to resolve dependency tree
error while installing dependenciesExpected Behavior:
Successful installation of dependencies
Steps To Reproduce:
rm -rf node_modules package-lock.json
Environment:
Error
package.json