Problems installing edge impulse cli

Hi! I am a new edge impulse and arduino user and I am having problems with the edge impulse cli. I’ ve just installed the latest python and node updates and when i type “npm install -g edge-impulse-cli” in the cmd I get these errors:

npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Iñaki\AppData\Local\npm-cache_logs\2021-05-18T09_41_16_553Z-debug.log

I tried the suggestion ( “npm i --package-lock-only”) and this is what I get :

npm ERR! code EPERM
npm ERR! syscall open
npm ERR! path C:\Windows\System32\package-lock.json
npm ERR! errno -4048
npm ERR! Error: EPERM: operation not permitted, open ‘C:\Windows\System32\package-lock.json’
npm ERR! [Error: EPERM: operation not permitted, open ‘C:\Windows\System32\package-lock.json’] {
npm ERR! errno: -4048,
npm ERR! code: ‘EPERM’,
npm ERR! syscall: ‘open’,
npm ERR! path: ‘C:\Windows\System32\package-lock.json’
npm ERR! }
npm ERR!
npm ERR! The operation was rejected by your operating system.
npm ERR! It’s possible that the file was already in use (by a text editor or antivirus),
npm ERR! or that you lack permissions to access it.
npm ERR!
npm ERR! If you believe this might be a permissions issue, please double-check the
npm ERR! permissions of the file and its containing directories, or try running
npm ERR! the command again as root/Administrator.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Iñaki\AppData\Local\npm-cache_logs\2021-05-18T09_41_25_824Z-debug.log

If anyone could help I’d really appreciate it!! :slight_smile:

Hello @txol,

Can you try using this command:

npm install edge-impulse-cli -g --force

Let me know if it works.

Regards,

Louis

1 Like

Hello @louis! Thanks for your answer. unfortunately I still get this:

C:\Windows\System32>npm install edge-impulse-cli -g --force
npm WARN using --force Recommended protections disabled.
npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

added 295 packages, and audited 296 packages in 24s

14 packages are looking for funding
run npm fund for details

5 vulnerabilities (1 low, 4 moderate)

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.

C:\Windows\System32>npm audit
npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Iñaki\AppData\Local\npm-cache_logs\2021-05-18T18_42_13_735Z-debug.log

It seems that the logs you are showing after the npm install edge-impulse-cli -g --force are only warnings. I guess it should work now. Let me know :slight_smile:

Regards,

Louis

1 Like

Aren’t these (at the end of my previous message) the same errors that I was getting before?

npm ERR! code ENOLOCK
npm ERR! audit This command requires an existing lockfile.
npm ERR! audit Try creating one first with: npm i --package-lock-only
npm ERR! audit Original error: loadVirtual requires existing shrinkwrap file

I kept going with the process and the “edge-impulse-daemon” command is not recognised as such.
Thank you very much!!

Hello there!! I’ve tried running the command prompt as an admin. It aparently works since I don’t get any more errors with de edge-impulse-cli installation. However, the “edge-impulse-daemon” command is still not recognised as such. This is my command prompt screen.

C:\WINDOWS\system32>npm install -g edge-impulse-cli --force
npm WARN using --force Recommended protections disabled.
npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated request-promise@4.2.6: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142

changed 295 packages, and audited 296 packages in 21s

14 packages are looking for funding
run npm fund for details

2 low severity vulnerabilities

Some issues need review, and may require choosing
a different dependency.

Run npm audit for details.

C:\WINDOWS\system32>npm audit
found 0 vulnerabilities

C:\WINDOWS\system32>edge-impulse-daemon
“edge-impulse-daemon” no se reconoce como un comando interno o externo,
programa o archivo por lotes ejecutable.

Alternatively, you can remove your npm package by doing npm uninstall -g edge-impulse-cli.
And then use this script for the installation:

1 Like

@txol FYI you can use this too https://www.edgeimpulse.com/blog/collect-sensor-data-straight-from-your-web-browser as a quick workaround while @louis is figuring out what’s going on :slight_smile:

Thanks @louis!! the script seems to work fine when it comes to downloading but the edge-impulse-daemon command is still not recognised in the command prompt nor the powershell (I’ve also followed the firmware and arduino-cli instructions).

Thank you!! I’ll give it a try if the edge-impulse-daemon keeps avoiding me :wink:

I finally got it wright!! after following your instructions with the script I just needed to add the edge-impulse-daemon folder to path. Thank you so much @louis :slight_smile:

1 Like

Awesome, glad to hear that it works now!

1 Like

Buenas tardes txol como hizo para agregar la carpeta edge-impulse-daemon a la ruta

Hola @luis1993,

Sorry for the delay, I missed your question…
Which OS are you using? You can follow this to add edge-impulse-cli to your PATH: https://docs.edgeimpulse.com/docs/cli-installation#installation---linuxubuntu-and-raspbian-os

Saludos,

Louis

estoy usando windows 10 y presento el siguiente error
edge-impulse-daemon
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module ‘C:\Users\DELL.npm-global\node_modules\edge-impulse-cli\build\cli\daemon.js’
←[90m at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)←[39m
←[90m at Function.Module._load (internal/modules/cjs/loader.js:746:27)←[39m
←[90m at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)←[39m
←[90m at internal/main/run_main_module.js:17:47←[39m {
code: ←[32m’MODULE_NOT_FOUND’←[39m,
requireStack: []
}

Hola @luis1993

Aquí hay algunas opciones que pueden ayudarte:

  • Reinicia tu computadora
  • Asegúrate de estar usando Python 3.7 o superior.
  • Reinstala nodeJS v14 o superior y asegúrate de instalar “chocolately” (not selected by default):

Espero que esto pueda ayudarte

Saludos,

Louis

I could not install Edge Impulse CLI, can you help mig, pleas.

Hi! I have an issue regarding the installation of Edge Impulse CLI. Hoping for a response ty.

Hi @yan_48,

In my experience, you need to install exactly Visual Studio 2019 for Windows (it looks like you have the 2022 version installed). You will likely need to uninstall and reinstall node.js and the CLI tool. Please try the following troubleshooting steps in these threads: