During switchover from redis to mongo, the lack of the lavender theme breaks the install
-
So a bit of history how I found this:
Originally I started testing node using the default redis database. Great and all, never had an issue. Began playing with node quite a bit, but knowing in the back of my mind I would need to switch over to mongo at some point. That time has come, and while struggling initially with mongo, I finally got the install to complete the database part only to be struck down in my glory with another bug:
warn: NodeBB Setup Aborted. ENOENT, open '/opt/nodebb/install/nodebb/node_modules/nodebb-theme-lavender/theme.json'
After a little bit of hunting, I discovered that the setup process explicitly requires the lavender theme to be installed. I had removed it during my testing and only had the vanilla theme installed. So running the --setup over the first install didnt quite like the fact that I had removed the theme.
So my suggestion is to modify the setup script to do either of the following rather than killing itself.
- search for the lavender theme first, if not found actually re-download it.
- search for any other theme installed and use that instead.
-
Right before running
./nodebb setup
, you're supposed to runnpm install
, which also fetched the Lavender theme.
If, for some godforsaken reason, you remove stuff between these two commands, you should runnpm install
again because it installs all the packages that are needed to get NodeBB to initially work and install. Because Lavender is the default theme and is guaranteed to be installed if you actually follow every setup guide that's around, this fails without Lavender installed, just like it would fail without the bcryptjs and gravatar packages installed.If you want to modify database settings on an already existing installation, just modify
config.json
instead of running the installer all over again. The installer is for just that: installing. Not for modifying any other settings on an existing installation. -
Since there is currently no easy way to migrate over from redis to mongo... running the install on an existing installation is necessary to populate mongo (even just the administrative user)... So running setup is the only option to switch over at this point. Hence the problem and the reason I posted.
-
@nexed said:
Since there is currently no easy way to migrate over from redis to mongo... running the install on an existing installation is necessary to populate mongo (even just the administrative user)... So running setup is the only option to switch over at this point. Hence the problem and the reason I posted.
Alright, but the fact remains that before running
./nodebb setup
,npm install
has to be run first. Becausenpm install
makes sure all of the requirements are met, there is no reason to perform those same checks again in./nodebb setup
.Considering there is currently no "proper" way to switch between databases, you are right in saying that
./nodebb setup
needs to be run to populate the database. However, it will not move over the already existing data, hence it would be easier to just install another copy of NodeBB with your new database settings in another folder and copy over the old node_modules folder from the previous installation afterwards. This should also solve the error you are having.