0

Total Linux noob here. I am trying to configure a Pleroma development environment on DO droplet. Installed LEMP, installed SSL, installed PostgreSQL, installed Pleroma, so far so good.

Then I installed Node, NPM, cloned Pleroma-FE (apparently it installs in /user/pleroma-fe folder). I am following the very brief build instructions here:

https://git.pleroma.social/pleroma/pleroma-fe

When I get to the command in those build instructions: npm run build

I am getting error: Error: Cannot find module '/user/build/build.js'

It's because actual path to the build file is /user/pleroma-fe/build/build.js

Apologies if this is a duplicate. I see other questions about this.

Fixing npm path in Windows 8 and 10

and the reply seems to set the PATH. This answer might apply to my situation. But my question is: it is clearly already looking in a well defined path (which is different from all the other questions, which don't seem to have well defined path in the error message). But it is the wrong path. How do I make it look in the correct path?

I tried the npm command and specified the complete path, and every variation. and none worked. So it seems fixing the path won't fix this problem.

Sorry I do not currently know enough Linux to be able to fix this. I tried to tag this with Pleroma but I don't have enough reputation to create a new tag. Any help is much appreciated. Thanks in advance.

1 Answers1

0

I continued to work on this with some help of a Linux admin on Fiverr and the Pleroma developers chat with success, thanks to all.

The solution did not involve changing the path. There were several different things going on. First, I needed to change directory into the development project source folder:

cd pleroma-fe

Once I did that, npm found the build module. Next issue was Node was very old and I needed to get the latest version. I used the instruction here for NodeJS (10):

https://nodejs.org/en/download/package-manager/#debian-and-ubuntu-based-linux-distributions

Next issue was npm was missing some modules. This was fixed with:

npm install

After that the build completed with no errors.

npm run build 

After a successful build, you will see a list of files that have changed as a result of the build.

Next issue is that simple changes in HTML text were not live, ie. not reflected in the refreshed web page. This is fixed by copying all the resulting build files to the production folder using rsync. In my case the command was:

rsync -av /user/pleroma-fe/dist/ /home/pleroma/pleroma/priv/static/

Pleroma is a neat Twitter-like user interface to ActivityPub fediverse, it includes a Mastodon UI as well, and thanks to the developers for making it free and open source.