TypeError: Cannot read property '1' of null
See original GitHub issueTrying to bootstrap my Node application, getting the following error, don’t know how to proceed:
TypeError: Cannot read property '1' of null
/home/vcap/app/node_modules/knex/lib/dialects/postgres/index.js:128
at emitOne (events.js:95:20)
at Socket.<anonymous> (/home/vcap/app/node_modules/pg/lib/connection.js:109:12)
at emitOne (events.js:90:13)
resolver(/^PostgreSQL (.*?)( |$)/.exec(resp.rows[0].version)[1]);
^
at Socket.emit (events.js:182:7)
at readableAddChunk (_stream_readable.js:153:18)
at Socket.Readable.push (_stream_readable.js:111:10)
at TCP.onread (net.js:534:20)
at null.<anonymous> (/home/vcap/app/node_modules/pg/lib/client.js:163:19)
at Query.handleReadyForQuery (/home/vcap/app/node_modules/pg/lib/query.js:89:10)
at null.callback (/home/vcap/app/node_modules/knex/lib/dialects/postgres/index.js:128:69)
at emit (events.js:182:7)
npm ERR! Linux 3.19.0-33-generic
npm ERR! argv "/home/vcap/app/vendor/node/bin/node" "/home/vcap/app/vendor/node/bin/npm" "start"
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (1 by maintainers)
Top Results From Across the Web
Cannot read property '1' of null(…) in a JavaScript function
Uncaught TypeError: Cannot read property '1' of null(…) in a JavaScript function · 2 · Pretty obvious by the error - you're trying...
Read more >cannot read property "1" from null - Error handling - ServiceNow
Hi Team,. I have a regex to match something and if the regex doesn't find things, its returning and rest of the code...
Read more >Cannot read property '1' of null (Example) - Treehouse
Hey, I'm having a problem I can't quite resolve, my code isn't working and I'm not able to find out why ... Cannot...
Read more >Uncaught TypeError: Cannot read property of null - iDiallo
This error occurs when you read a property or call a method on a null object . That's because the DOM API returns...
Read more >Uncaught TypeError: Cannot read property '1' of null
The plug-in immediatly throws this error when visiting the check-out page, and does the same when details are being changed.
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 Free
Top 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
The fix is to change
client: 'pg'
toclient: 'cockroachdb'
and it doesn’t feel like it should work because you haven’t installed a cockroachdb specific driver (just thepg
one), but it does work.I just tried it out and it worked.
I encounter this issue while using enterpriseDB: https://www.enterprisedb.com/ query “select versions()” return “EnterpriseDB 9.6.18.25 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.8.5 20150623 (Red Hat 4.8.5-36), 64-bit” therefore the regex
"/^PostgreSQL (.*?)( |$)/.exec(resp.rows[0].version)"
return null in this case