OpenCV.js built with Emscripten not working with NodeJS

I’m following this official OpenCV tutorial.

example1.js is specified as:

// Define a global variable 'Module' with a method 'onRuntimeInitialized':
Module = {
  onRuntimeInitialized() {
    // this is our application:
// Load 'opencv.js' assigning the value to the global variable 'cv'
cv = require('./opencv.js')

When I run this with ‘node example1.js’, nothing is output from the call to console.log. This leads me to believe that maybe the emscripten Module functionality might not working as intended, causing onRuntimeInitialized to never be called.

I believe I am doing everything I should be in regards to setting up emsdk to work. I am doing this on Linux, so am running ./emsdk activate 2.0.10 (the latest version that supports wasm) and source ./

Any help identifying the issue would be greatly appreciated! :slight_smile: