How do I know what modules should I install to get this working?
Try to use 'use strict' in the first lineof each js script, if you dont know what is it here we have some help https://www.w3schools.com/js/js_strict.asp
I see in some scripts you use var and in others you're using let and const, why are you diff?
it is highly recomended to use curly braces, sometimes if you minify the code you can get errors
Better use '===' instead of '==' 1 == '1' // true 1 === '1' // false