Confusion on where nodejs is installed?
-
Running two nodebb websites now
I got some help installing the second one and something looks odd to me.
The directories var/www/site1.com and var/www/site2.com both have directories called node_modules.
It seems node has been installed twice.
Does each website need its own node installation?
Surely there is a better way to organise it?So this is not related to my previous question if nodebb files need to be installed twice, its about node runtime itself.
I just assumed you only need one lot of that per server? -
@eeeee As I previously mentioned, this could work, but it's not the way I'd do it. For example, I have three NodeBB instances on my server, and each maintains its own set of files independent of the others. If you make changes to one instance, then the others are likely to potentially suffer as a result because you are changing a central repository rather than a dedicated instance.
-
@eeeee You may be confusing terms here.
The node runtime is executed by running
node
ornodejs
or/usr/bin/env node
or something like that. It is installed on the system (usually), and you only install it once.node_modules/
folder contains the plugins and dependencies required by NodeBB. Things like CSV parsers, the plugins, themes, authenticator tools, etc.You could share that directory between installs, but as @phenomlab said, it's simpler to just have two directories.