0

If I want to start my node.js (v10.6.0) app on my Raspberry Pi 3 B+ (OS Raspbian Stretch) via

npm run start:prod 

and my MongoDB (v2.4) was started before via

sudo mongod

I receive this error message

info: Runnning in production mode (server/dist/index.js)
info: Starting server on port 8000...
info: Connecting to database at mongodb://localhost:27017/mldms...
(node:1826) DeprecationWarning: current URL string parser is deprecated, and will be removed in a future version. To use the new parser, pass option { useNewUrlParser: true } to MongoClient.connect.
warn: Couldn't connect to a database: MongoError: Server at localhost:27017 reports wire version 0, but this version of Node.js Driver requires at least 2 (MongoDB2.6).

I read from another forum you can only download MongoDB version 2.4 for Raspberry Pi. Is there any possibility to fix this problem, so I can connect to my MongoDB? I was also thinking of downgrading node.js.

  • Upgrading to a new versions is usually better for security patches, but in this case MongoDB seems a bit of a challenge. andyfelong.com/2018/03/… Downgrading nodejs is also an option if you absolutely need to. I considered MongoDB myself for Rpi3 but just went with a small, simple SQL database such as SQLite3. – OyaMist Jul 6 '18 at 15:05
  • I tried to reinstall node.js and I now have version 8.11. the version of npm is 6.1.0 and of Angular CLI 6.0.8. But I still couldn't connect to my Mongo Database. Are there any bug fixes or something? If not I will try SQLite3. – Ramón Wilhelm Jul 8 '18 at 19:40
2

NoSQL databases such as MongoDB were developed for solving different problems than SQL databases. MongoDB, for example, is a document-oriented database, which might be an unusual application for a Raspberry Pi given its relatively small store (e.g., 16GB SD card).

A more typical Raspberry Pi database application might, for example, involve sensor-based automation. For Raspberry Pi applications that store and analyze regular datastreams (e.g., timestamped temperatures, humidity, etc.), it's enough to use a simple SQL database such as SQLite.

Going downrev for compatibility with Nodejs is a tricky proposition. Nodejs regularly incorporates security updates which might not be available in a downrev version. And upgrading MongoDB can be challenging on Raspberry Pi.

For Raspberry Pi databases, choose the simplest SQL or NoSQL database your application requires. The Raspberry Pi has limited resources and over-featured software works against you.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.