Using npm roachjs

hello -

i am having issues starting the first node roachjs example. following the simple certification steps here in step one, and trying to run the following example script:

const client = new Roach({
uri: ‘https://10.138.0.2:8080
// and YES i tried localhost as well. even an idiot newbie will try that.
})
module.exports = client
client.get(“sample_key”, function(err, value, res) {

i keep getting the following node error:

/root/roach/roach.js:17
if(err) throw err
^
Error: unable to verify the first certificate
at Error (native)
at TLSSocket. (_tls_wrap.js:1060:38)
at emitNone (events.js:86:13)
at TLSSocket.emit (events.js:185:7)
at TLSSocket._finishInit (_tls_wrap.js:584:8)
at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:416:38)

any suggestions what i might be doing incorrectly? it would be helpful to see a complete example of cockroachdb/node, although i certainly understand that cockroachdb is still a young database and there are many other language interfaces vying for attention.

or, is there a better node-interface package i should be using? (i already voted for sequelize here).

I also tried senaca but ran into npm installation problems. RoachJS seems like it is the easier of the two for a newbie.

also, is there any sort of daily maximum “question quota” i should be aware of? (rhetorical question)

Hey!

Unfortunately, that Node.js library is over a year old and isn’t maintained by us, so the API it uses should no longer work.

On the bright side, we’ve switched to using the same protocol as postgres, which means you won’t need a special Cockroach specific library.

Check out the Node.js example on this page: https://www.cockroachlabs.com/docs/build-a-test-app.html and let us know if you run into any issues.

-Max

2 Likes

max - that node example you graciously shared with me worked perfectly and flawlessly just using a simple cut-paste. thank you so much for your assistance.

1 Like

Edvard, I could recommend you take a look also at this article - Discover Top JavaScript Libraries to Keep an Eye on in 2017 I’m sure you will like it

thanks - i actually saw that one earlier. the quest for a framework continues, SLOWLY.

feathers.js has a sequelize interface built in, but i am not sure if that is an advantage or not, if one is already familiar with node. from my studies, vue looks the most promising.

Thanks for sharing. I would like to add this article TOP 7 JavaScript Libraries That Worth Your Attention.
A library is an organized collection of useful functionality. A typical library could include functions to handle strings, dates, HTML DOM elements, events, cookies, animations, network requests, and more. This article explains the basics and rudimentary differences between the most popular JavaScript libraries. Whether they become “best” for you is another question. But still all of them worth trying!