Error using uploader CLI tool in Google Colab

I’m creating a Colab script for a workshop, and I’d like to have it send curated audio files (.wav) to Edge Impulse via the uploader tool. In one cell, I installed the CLI tool with:

!npm install -g --unsafe-perm edge-impulse-cli

I then run the uploader tool with:

!edge-impulse-uploader \
  --category training \
  --api-key {EI_API_KEY} \

I get the following error:

Edge Impulse uploader v1.8.3

Upload configuration:
    Label:       Not set, will be infered from file name
    Category:    training

Failed to upload files Cannot read property 'readFile' of undefined
TypeError: Cannot read property 'readFile' of undefined
    at processFile (/tools/node/lib/node_modules/edge-impulse-cli/build/cli/uploader.js:260:56)
    at Promise.resolve.then (/tools/node/lib/node_modules/edge-impulse-cli/node_modules/tiny-async-pool/lib/es7.js:18:44)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)

I’ve verified that _noise.000.wav exists at the location specified. I realize that running this tool within Colab is odd, but I figured it might make for a better experience for workshop attendees rather than installing Python and downloading/uploading GBs of audio data from their local machine.

@ShawnHymel This smells like an old Node.js version to me! We need Node.js v12 at least. Any idea if that’s updateable on Colab?

1 Like

@janjongboom Thank you!

!npm cache clean -f
!npm install -g n
!n stable

did the trick :smile:

1 Like

From CLI version 1.8.4 there’s now a Node.js version check on startup!

1 Like