I can't finish my Jitsi server setup - webpack problem

So, i followed the step by step guide provided by @corby [How to] How to build Jitsi Meet from source: A developer's guide, this is my third try building it from zero and i can’t find the solution.

cd ~/jitsi-meet/
make

always return

./node_modules/.bin/webpack
make: ./node_modules/.bin/webpack: Command not found
make: *** [Makefile:23: compile] Error 127

Tried many solutions like deleting node_modules the running npm install and many variations of that and even installing webpack globally. I don’t understand node very well but it seems like the folder .bin is not being created because of the package.json.lock.

MORE INFO:
ubuntu x64 20.04 - OCEAN DIGITAL
Node 14xx (16 and 18 didn’t work)
NPM 8.5x

Any suggestions?

Thanks for the attention

Did you try the combination of npm 8 and node 16?

Yes, just changed again but it didn’t work. Also if i use npx webpack and the response is:

sh: 1: webpack: not found

Can i change the path where webpack is being searched?

You are missing the npm install step.

1 Like

I did the npm install step, but to be sure i tried installing it again from zero with a new server (2gb ram) and i still cant use the command make inside /home/user/jitsi-meet.

For the record the .bin folder doesn’t exist

./node_modules/.bin/webpack
make: ./node_modules/.bin/webpack: Command not found
make: *** [Makefile:23: compile] Error 127

Using ‘npx webpack’ or only ‘webpack’ is returning

[BABEL] Note: The code generator has deoptimised the styling of /home/well/jitsi-meet/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/well/jitsi-meet/node_modules/@vladmandic/human/dist/human.esm.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/well/jitsi-meet/node_modules/lodash/lodash.js as it exceeds the max of 500KB.
[BABEL] Note: The code generator has deoptimised the styling of /home/well/jitsi-meet/node_modules/lodash/lodash.js as it exceeds the max of 500KB.

<--- Last few GCs --->

[49864:0x64106a0]   200577 ms: Scavenge 976.3 (1005.7) -> 974.1 (1005.9) MB, 18.2 / 0.0 ms  (average mu = 0.657, current mu = 0.630) allocation failure
[49864:0x64106a0]   200626 ms: Scavenge 976.8 (1005.9) -> 974.9 (1006.9) MB, 17.8 / 0.0 ms  (average mu = 0.657, current mu = 0.630) allocation failure
[49864:0x64106a0]   200663 ms: Scavenge 977.9 (1006.9) -> 975.9 (1015.9) MB, 8.5 / 0.0 ms  (average mu = 0.657, current mu = 0.630) allocation failure


<--- JS stacktrace --->

FATAL ERROR: Reached heap limit Allocation failed - JavaScript heap out of memory
 1: 0xb09c10 node::Abort() [webpack]
 2: 0xa1c193 node::FatalError(char const*, char const*) [webpack]
 3: 0xcf8dbe v8::Utils::ReportOOMFailure(v8::internal::Isolate*, char const*, bool) [webpack]
 4: 0xcf9137 v8::internal::V8::FatalProcessOutOfMemory(v8::internal::Isolate*, char const*, bool) [webpack]
 5: 0xeb09d5  [webpack]
 6: 0xec069d v8::internal::Heap::CollectGarbage(v8::internal::AllocationSpace, v8::internal::GarbageCollectionReason, v8::GCCallbackFlags) [webpack]
 7: 0xec339e v8::internal::Heap::AllocateRawWithRetryOrFailSlowPath(int, v8::internal::AllocationType, v8::internal::AllocationOrigin, v8::internal::AllocationAlignment) [webpack]
 8: 0xe848da v8::internal::Factory::NewFillerObject(int, bool, v8::internal::AllocationType, v8::internal::AllocationOrigin) [webpack]
 9: 0x11fd626 v8::internal::Runtime_AllocateInYoungGeneration(int, unsigned long*, v8::internal::Isolate*) [webpack]
10: 0x15f2099  [webpack]
Aborted (core dumped)

maybe your npm install is not finishing successfully.
The error is that there is not enough ram to finish the process.

1 Like

Do you have swap memory?

1 Like

You were right about it. I tried with 1gb and 2gb without success. But with 4gb ram it works fine.

@corby @damencho Please include in the guide this requirement, could have save me a lot of time

Thanks guys

Hi guys, if you are getting the “JavaScript heap out of memory” error please know that the error occurs due to lack of memory, as previous users already mentioned above. I found the following command to be real useful in my setup:

export NODE_OPTIONS=–max_old_space_size=8192

Ubuntu 18.04 or 20.04 will do
4GB RAM + 8GB [swap file](https://linuxize.com/post/create-a-linux-swap-file/) (very important)
Node v16.16.0, npm v8.11.0 (or v14 & v6 should be ok too)

You should set that NODE_OPTIONS variable right before using ‘make’ cmd in /jitsi-meet (assuming you are following Corby’s Developer Guide). That will tell node to use 8GB ram instead of the default (0.5GB or so). You may adjust the ram amount based on the resources you have (including your swap file). Another good tip is to open a second SSH session into your server and try the top/htop commands (can see memory usage live). Note that the build can take over 5 minutes. You will know it is progressing if you see the ram usage increase to almost 100% of internal and about 60% of swap (based on default swappiness value in linux, see article^^). Hope that helps!

2 Likes

In my case “make” only completed after reserving 16 GB RAM for VM (no swap).
Failed with 8 GB RAM…