Problem installing following docs for mac osx install and using mongodb
-
I am trying to install by following these instructions at https://docs.nodebb.org/configuring/databases/mongo/
I got up to the part where it says to create the db and add user. That part worked OK and I got a confirmation message in the terminal.
However, the next part which is:
<db.grantRolesToUser("nodebb",[{ role: "clusterMonitor", db: "admin" }]);/>
didn't seem to do anything. I didn't get any error message but nothing happened.
Anyway I kept going and I tried to modify the
/etc/mongodb.conf
However, when I checked that by going to the file, I couldn't find
security:
so there was nothing to add to the file.It just contained:
destination: file path: /usr/local/var/log/mongodb/mongo.log logAppend: true storage: dbPath: /usr/local/var/mongodb net: bindIp: 127.0.0.1
So I wasn't sure if the installation was going to work. Anyhow I did the next step which was to restart mongodb.
So I put in the command:
service mongodb restart
However, that command did not seem to do anything. But I think the mongo shell was still open. I opened it in a separate terminal window.
Then I followed the two next steps which were:
$ cd /path/to/nodebb
and
$ node app --setup
.After I put in the last command, I got an error message:
bb/nodebb/app.js:39 const configFile = path.resolve(__dirname, nconf.any(['config', 'CONFIG']) || 'config.json'); ^ TypeError: nconf.any is not a function at Object.<anonymous> (/Users/home/Downloads/WEBSITE/experiments/nodebb/nodebb/app.js:39:50)
I don't know what I'm doing wrong or if there is a bug in the app.js file.
-
If there's no already a
security
bit in the config file, then you need to appendsecurity: authorization: enabled
At the end of the file.
That tutorial is quite outdated though, I recommend following the ubuntu tutorial which also uses MongoDB: https://docs.nodebb.org/installing/os/ubuntu/#configure-mongodb
If you continue with that tutorial it'll tell you to use
./nodebb setup
instead ofnode app --setup
. -
I was able to install it by following the instructions from here: https://products.containerize.com/discussion-forum/nodebb
I already have node.js installed on my computer. I did not install redis or nginx.
I have a mac, so on Terminal, after I created a directory called "nodebb", I skipped the first few lines of the instructions, and just pointed to the directory I created, by using the "cd" command. I then created another directory called NodeBB inside the nodebb directory. You may skip creating two directories and just create a directory called "NodeBB". I pointed to this directory by using the cd command.
Then this line
"git clone -b v1.15.x https://github.com/NodeBB/NodeBB.git ."
was the key for me.
After I typed that, nodebb was cloned to the directory.
Then I ran "./nodebb setup".
I used mongo for the database.
When prompted, I pasted the connection string that I got from mongodb's site. I substituted "nodebb" for the database part in the string. (I set up mongodb (Cloud Atlas) beforehand). The instructions that come up on Terminal will tell you to call your database "nodebb".
After that step, the program ran automatically and installed the files. It asked me to put in the username and password for mongodb and it also asked me to choose a name for admin and password. You might have to wait a while as it pauses for a long time after "Confirm Password". I thought there was some problem and was tempted to abort the operation, as it was taking a long time, but it did come up with further instructions after a while.
I typed "./nodebb start" when the setup finished and then went to "localhost:4567", and this time, I was able to see a normal board, and could log in as admin.
I write this follow-up in case another mac user has trouble installing nodebb. In the end, setup was pretty straightforward and did not involve a lot of steps. My OS is High Sierra.
The instructions, including the ones for Linux, at the official nodebb site did not work for me.