I also searched on the forum, but no success. Any ideas what could be wrong? I don’t have any experience with nodejs thus it’s quite hard for me to debug.
Got the same errors on 64-bit bookworm install as well (which I expected). I also reinstalled on Bullseye, per above.
Full error:
Error: Cannot find module 'node-fetch'
Require stack:
- /usr/lib/node_modules/edge-impulse-linux/build/cli/make-image.js
- /usr/lib/node_modules/edge-impulse-linux/build/cli/linux/linux.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:931:15)
at Function.Module._load (internal/modules/cjs/loader.js:774:27)
at Module.require (internal/modules/cjs/loader.js:1003:19)
at require (internal/modules/cjs/helpers.js:107:18)
at Object.<anonymous> (/usr/lib/node_modules/edge-impulse-linux/build/cli/make-image.js:8:38)
at Module._compile (internal/modules/cjs/loader.js:1114:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1143:10)
at Module.load (internal/modules/cjs/loader.js:979:32)
at Function.Module._load (internal/modules/cjs/loader.js:819:12)
at Module.require (internal/modules/cjs/loader.js:1003:19) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/usr/lib/node_modules/edge-impulse-linux/build/cli/make-image.js',
'/usr/lib/node_modules/edge-impulse-linux/build/cli/linux/linux.js'
]
}
Please note that if you’re using NVM and also following our Raspberry Pi 4 documentation then you may end up with multiple/conflicting Node in your system.
To confirm which Node you are running, can you run:
which node
node --version
If you have don’t the right Node. Please clean up any other node installation and install the right version of Node as mentioned above.
Then uninstall edge-impulse-linux
npm uninstall -g edge-impulse-linux
npm prune
Then install edge-impulse-linux. Then confirm you have v1.8.2.
edge-impulse-linux-runner --version
Noticed I used edge-impulse-linux-runner above and not edge-impulse-linux. edge-impulse-linux command is broken in v1.8.1. If you have v1.8.2 then edge-impulse-linux command will also work.
Above, @shawn_edgeimpulse suggested pinning to v14, v16 or v20. As I mentioned, I started with v16 and then installed nvm manager to be able to switch to 14. Had v16 worked, I would not have installed NVM separately.
corey@CKPiFour:~ $ edge-impulse-linux-runner
Edge Impulse Linux runner v1.8.0
? What is your user name or e-mail address (edgeimpulse.com)? xxxxx
? What is your password? [hidden]
[RUN] Downloading model...
[RUN] Failed to run impulse Missing impulse
Uninstalled, prune, then reinstalled edge-impulse-linux. Rebooted.
corey@CKPiFour:~ $ edge-impulse-linux --version
1.8.0
corey@CKPiFour:~ $ edge-impulse-linux-runner --version
1.8.0
corey@CKPiFour:~ $ edge-impulse-linux-runner
Edge Impulse Linux runner v1.8.0
[RUN] Downloading model...
[RUN] Failed to run impulse Missing impulse
corey@CKPiFour:~ $ edge-impulse-linux
Edge Impulse Linux client v1.8.0
[GST] checking for /etc/os-release
[SER] Using microphone hw:0,0
Failed to initialize linux tool Error: Cannot find any webcams, run this command with --disable-camera to skip selection
at /usr/lib/node_modules/edge-impulse-linux/build/cli/linux/linux.js:444:23
corey@CKPiFour:~ $ edge-impulse-linux --disable-camera
Edge Impulse Linux client v1.8.0
[SER] Using microphone hw:0,0
[WS ] Connecting to wss://remote-mgmt.edgeimpulse.com
[WS ] Connected to wss://remote-mgmt.edgeimpulse.com
[WS ] Device "CKPi4" is now connected to project "RadarPi".
So I’m still not sure how to update to 1.8.2, but at least it connects. Still doesn’t with edge-impulse-linux-runner. And will need to figure out how to run with the camera, though.
corey@CKPiFour:~ $ edge-impulse-linux-runner
Edge Impulse Linux runner v1.8.0
[RUN] Downloading model...
[RUN] Failed to run impulse Missing impulse
It looks like edge-impulse-linux tool is is not throwing the previous error.
The issue with the camera on rpi 4 (on bookworm). We’re working on adding support for RPI 4 on bookworm.