Edge impulse CLI installation fail

Hi,

I’ve tried to install Edge impulse CLI a few times over the last days, but it didn’t ended up working.

I’ve followed other threads with the same type of error, but it doesn’t seem to fix it.

I ended up using Chocolatey from GitHub - edgeimpulse/ei-install-scripts: Set up an environment for running the Edge Impulse CLI and my actual error log is:

PS C:\arduino> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr -Uri “https://raw.githubusercontent.com/edgeimpulse/ei-install-scripts/main/install-windows.ps1” -Outfile install.ps1; iex .\install.ps1; del .\install.ps1
[^^] Refreshed Environment
[^
^] Running as admin on amd64
[><] Edge Impulse CLI is not installed.
Checking if you have Node.js v12 or higher installed…
[^
^] Node.js v14.18.1 installed!
Checking if you have Python 3.7 or higher installed…
[^_^] Python 3.12.0 installed!
Downloading the Build Tools for Windows bootstrapper, this may take a few minutes…
Checking your Build Tools for Windows configuration. This may take several minutes…
Installing the Edge Impulse CLI…
npm install -g edge-impulse-cli
npm WARN deprecated request@2.88.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN deprecated request-promise@4.2.4: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142
npm WARN deprecated @zeit/dockerignore@0.0.5: “@zeit/dockerignore” is no longer maintained
npm WARN deprecated uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated har-validator@5.1.5: this library is no longer supported
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · debug-js/debug · GitHub)
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-uploader → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\uploader.js
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-blocks → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-daemon → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-run-impulse → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\run-impulse.js
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-data-forwarder → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\data-forwarder.js
C:\Users\Joselito\AppData\Roaming\npm\eta-flash-tool → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\eta-flash-tool\flashtool.js
C:\Users\Joselito\AppData\Roaming\npm\himax-flash-tool → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\himax-flash-tool\flashtool.js
C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-framebuffer2jpg → C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\framebuffer-to-jpg.js

@serialport/bindings@8.0.8 install C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules@serialport\bindings
prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild

prebuild-install WARN install No prebuilt binaries found (target=14.18.1 runtime=node arch=x64 libc= platform=win32)

C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules@serialport\bindings>if not defined npm_config_node_gyp (node “C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin\…..\node_modules\node-gyp\bin\node-gyp.js” rebuild ) else (node “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” rebuild )
Traceback (most recent call last):
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py”, line 50, in
sys.exit(gyp.script_main())
^^^^^^^^^^^^^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py”, line 554, in script_main
return main(sys.argv[1:])
^^^^^^^^^^^^^^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py”, line 547, in main
return gyp_main(args)
^^^^^^^^^^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py”, line 520, in gyp_main
[generator, flat_list, targets, data] = Load(
^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp_init_.py”, line 136, in Load
result = gyp.input.Load(build_files, default_variables, includes[:],
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py”, line 2782, in Load
LoadTargetBuildFile(build_file, data, aux_data,
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py”, line 391, in LoadTargetBuildFile
build_file_data = LoadOneBuildFile(build_file_path, data, aux_data,
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py”, line 234, in LoadOneBuildFile
build_file_contents = open(build_file_path, ‘rU’).read()
^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: invalid mode: ‘rU’ while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: gyp failed with exit code: 1
gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:351:16)
gyp ERR! stack at ChildProcess.emit (events.js:400:28)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:282:12)
gyp ERR! System Windows_NT 10.0.19045
gyp ERR! command “C:\Program Files\nodejs\node.exe” “C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\bin\node-gyp.js” “rebuild”
gyp ERR! cwd C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules@serialport\bindings
gyp ERR! node -v v14.18.1
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
npm WARN tsargs@1.4.1 requires a peer of typescript@^3.1.6 but none is installed. You must install peer dependencies yourself.

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! @serialport/bindings@8.0.8 install: prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the @serialport/bindings@8.0.8 install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Joselito\AppData\Roaming\npm-cache_logs\2023-10-09T18_47_39_004Z-debug.log
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module ‘C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module.load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}
[>
<] Edge Impulse CLI is not installed.

I’ve tryied many solutions but this “Cannot find module ‘C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js’” seems to be the problem.

thanks in advance!

Hi @Josemoares,

I don’t recognize those exact errors. You may want to uninstall and reinstall node.js and reinstall the Edge Impulse CLI. Please refer to the following threads to see if any of the solutions presented there help resolve the issue:

Hi, thanks shawn,

Unfortunately I’ve followed those threads already because I had the same errors as some of them, but none of the solutions worked.

I’ve installed and unistalled python, node and visual studio several times but got the same log in the end.

For the moment I’m using the Chrome tool to connect the board (arduino 33 nano BLE sense), but it’ll be a problem again in hte future.

Thanks again for the response!

1 Like

I have a very similar problem a few days ago. I would suggest to use Python 3.9 instead of 3.12.

Uninstall Python 3.12 in control panel and delete the enviroment varible path for Python 3.12. Then just install Python 3.9 and run the install script again. Worth a try

1 Like

Hi! thanks for the response,

Unfortunately this error comes up:

PS C:\arduino> Set-ExecutionPolicy Bypass -Scope Process -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iwr -Uri “https://raw.githubusercontent.com/edgeimpulse/ei-install-scripts/main/install-windows.ps1” -Outfile install.ps1; iex .\install.ps1; del .\install.ps1
[^^] Refreshed Environment
[^
^] Running as admin on amd64
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module ‘C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js’
at Function.Module.resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module.load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}
[>
<] Edge Impulse CLI is not installed.
Checking if you have Node.js v12 or higher installed…
[^
^] Node.js v14.18.1 installed!
Checking if you have Python 3.7 or higher installed…
[^_^] Python 3.9.0 installed!
Downloading the Build Tools for Windows bootstrapper, this may take a few minutes…
Checking your Build Tools for Windows configuration. This may take several minutes…
Installing the Edge Impulse CLI…
npm install -g edge-impulse-cli
npm WARN deprecated request@2.88.0: request has been deprecated, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
npm WARN deprecated request-promise@4.2.4: request-promise has been deprecated because it extends the now deprecated request package, see Request’s Past, Present and Future · Issue #3142 · request/request · GitHub
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 uuid@3.4.0: Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See There’s Math.random(), and then there’s Math.random() · V8 for details.
npm WARN deprecated debug@4.1.1: Debug versions >=3.2.0 <3.2.7 || >=4 <4.3.1 have a low-severity ReDos regression when used in a Node.js environment. It is recommended you upgrade to 3.2.7 or 4.3.1. (ReDos Vulnerability Regression Visibility Notice · Issue #797 · debug-js/debug · GitHub)
npm WARN tsargs@1.4.1 requires a peer of typescript@^3.1.6 but none is installed. You must install peer dependencies yourself.

npm ERR! code EEXIST
npm ERR! path C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js
npm ERR! dest C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-blocks.cmd
npm ERR! EEXIST: file already exists, cmd shim ‘C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js’ → ‘C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-blocks.cmd’
npm ERR! File exists: C:\Users\Joselito\AppData\Roaming\npm\edge-impulse-blocks.cmd
npm ERR! Remove the existing file and try again, or run npm
npm ERR! with --force to overwrite files recklessly.

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\Joselito\AppData\Roaming\npm-cache_logs\2023-10-11T18_30_49_557Z-debug.log
internal/modules/cjs/loader.js:905
throw err;
^

Error: Cannot find module ‘C:\Users\Joselito\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js’
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:902:15)
at Function.Module.load (internal/modules/cjs/loader.js:746:27)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
code: ‘MODULE_NOT_FOUND’,
requireStack: []
}
[>
<] Edge Impulse CLI is not installed.

I’ve had this error log before, if I follow the path it says there, it doesn’t exist.

thanks again!

Hmm, Im not so sure now. Did you run the uninstall via npm uninstall -g edge-impulse-cli?

Yes, the same fail comes up

@Josemoares The error might be machine specific, aka, Python Dependency Hell (PyDH).

Some Alternate Solutions:

  • Here’s what I did to get the CLI to install under node v20.6.0
  • Try on another machine.
  • Try installing the EI CLI in a Docker Container.
  • Boot your computer from a thumb-drive configured for a bootable Ubuntu.
    • Then keep 1 flash drive per project so that you do not run into PyDH.
  • Back in July it was suggested to use node v16.13.1.

@Josemoares Try verifying if you have the right Visual Studio tools. I was facing the same errors and everything got solved once I installed the Visual Studio Build Tools: