Instead of Box2D, I'm using matter.js since it's JavaScript native, and it uses canvas coordinate system! However I had a lot of trouble importing it. First, I tried to import it as a module in my TypeScript file, but encountered an error: cannot assign "decomp" to undefined variable. Then I tried many things - use RequireJS instead of ES6 modules, use NodeJS, etc. None of them worked. Finally, I magically found out that I can just import matter.js through the plain old <script> tag, then just use it in code. The only problem left is TypeScript IntelliSense, and that was taken care of by npm install @types/matter-js (which also worked for dat.gui, yay!). Anyway, here is a lovely hello-world example of matter.js.
I had a lot of trouble importing matter.js libraries in this project, mainly because 1) it has bugs when imported as ES6 module, 2) I have no clue how to import npm package to TypeScript. This article explained it really well, it even spelled out the exact problems that I encountered.