Open ploissken opened 1 month ago
@SabreCat Can you take a look at this? Thanks!
@ploissken Never tried the regular install of Habitica (I want to make it work using docker), but I found out that the mongoose version 7.6.3 is messing things up when using mongo5 (again, this is my observation for docker containers)
I would suggest switching mongoose to 5.13.22 in package.json
@ploissken also, the Wiki (fandom) page seems outdated since Habitica 5.22 is supposed to run on Node20/Npm10.
@diyoyo you are correct--we are running Node 20 and MongoDB 5.0.23 now. I'd recommend that @ploissken run npm ci
to get a clean install of all the dependencies and try again--making changes to package.json
and getDevelopmentConnectionUrl
shouldn't be necessary!
General Info
Description
I was following instructions here for starting the server on localhost. I never had mongo installed here before. Running
npm run mongo:dev
resulted in an error:I went googling around and found a workaround. Posting it here to raise awareness about the issue and also in case anyone runs into it.
mongo:dev
script inpackages.json
. I've added-h 127.0.0.1
to it, following a hint from this thread. The updated line inpackage.json
now looks like this:"mongo:dev": "run-rs -v 5.0.23 -h 127.0.0.1 -l ubuntu1804 --keep --dbpath mongodb-data --number 1 --quiet",
/mongodb-data
npm run mongo:dev
again, the error is gone:Skipping purge Running '/Users/bodurico/Documents/habitica/node_modules/run-rs/5.0.23/mongod' [ 27017 ] Restarting replica set... Started replica set on "mongodb://127.0.0.1:27017?replicaSet=rs"
return "mongodb://127.0.0.1:27017?replicaSet=rs";
[17:24:10] Using gulpfile ~/Documents/habitica/gulpfile.js [17:24:10] Starting 'nodemon'... [17:24:10] Finished 'nodemon' after 13 ms [17:24:10] [nodemon] 2.0.22 [17:24:10] [nodemon] to restart at any time, enter
rs
[17:24:10] [nodemon] watching path(s): . [17:24:10] [nodemon] watching extensions: js,mjs,json [17:24:10] [nodemon] startingnode ./website/server/index.js
2024-04-18T20:24:12.339Z - info Express server listening on port 3000 2024-04-18T20:24:12.347Z - info Connected with Mongoose.