Error: The Module was compiled against a different Nodejs version

I am trying to use the Edge-Impulse CLI, and I have installed it with npm install -g edge-impulse-cli --force

However, this is the error when I try to run it edge-impulse-daemon

/usr/local/lib/node_modules/edge-impulse-cli/node_modules/bindings/bindings.js:121
        throw e;
        ^

Error: The module '/usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings/build/Release/bindings.node'
was compiled against a different Node.js version using
NODE_MODULE_VERSION 83. This version of Node.js requires
NODE_MODULE_VERSION 93. Please try re-compiling or re-installing
the module (for instance, using `npm rebuild` or `npm install`).
    at Object.Module._extensions..node (node:internal/modules/cjs/loader:1187:18)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Module.require (node:internal/modules/cjs/loader:1005:19)
    at require (node:internal/modules/cjs/helpers:102:18)
    at bindings (/usr/local/lib/node_modules/edge-impulse-cli/node_modules/bindings/bindings.js:112:48)
    at Object.<anonymous> (/usr/local/lib/node_modules/edge-impulse-cli/node_modules/@serialport/bindings/lib/darwin.js:2:36)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32) {
  code: 'ERR_DLOPEN_FAILED'
}

I even rebuilt the packages. It still gives me the error

Hello!

Which NodeJS version are you using?
Can you try with a fresh install of NodeJS ?

Regards,

Louis

@louis I am using v16.14.2. (through NVM)

Hello @ElectricDragon,

I just installed node v16.14.2 (using nvm too) and have installed again the edge-impulse-cli I have no issues when running the edge-impulse-daemon command :confused:

Which OS are you using? I am on MacOS.

Also, have you checked the troubleshooting section if any of the hints can solve your issue? Installation - Edge Impulse Documentation

Regards,

Louis

@louis I restarted my laptop and it’s working again. (I am on MacOS too)

1 Like

Hello @ElectricDragon,

Glad to hear that!

Regards,

Louis