You can follow the instructions in the section 3.4 of this tutorial to install dependencies for your JS Action.
Widgets Team – Mendix
Mendix 8.6 has a new feature to package some of your node modules in the repository, however this comes with the risk of overflowing SVN.
I have created a few pluggable widgets that wrap CryptoJs and Moment libraries. The widget does not render anything but pluggable widgets can package libraries where JS actions face trouble to say the least. So I expose the wrapped library through the widget, place the widget on the native home page and import it in my JS actions. A bit of a hack I suppose...