Edge-impulse-cli install

**Hi **
Please I need help.
I am an embedded engineer, 30+ years developing with microcontrollers !

After lots of problems trying to install edge-impulse-cli in my old machine , I am now using a new HD, fresh windows installation.

- Installed python 2.7 and 3.9.1
- node V14.15.5 (default options)
- arduino-cli
- path is OK
- rebooted many times.
- NO VSCode install
- NO VStudio install

And I receive this when try to install edge-impulse-clli:

C:\Windows\system32>npm install -g --force edge-impulse-cli
npm WARN using --force I sure hope you know what you are doing.
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142
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 @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
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-uploader -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\uploader.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-blocks -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\blocks.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-data-forwarder -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\data-forwarder.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-run-impulse -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\run-impulse.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-linux -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\linux\linux.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-linux-runner -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\linux\runner.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-daemon -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\daemon.js
C:\Users\vidal\AppData\Roaming\npm\himax-flash-tool -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\himax-flash-tool\flashtool.js
C:\Users\vidal\AppData\Roaming\npm\edge-impulse-framebuffer2jpg -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\framebuffer-to-jpg.js
C:\Users\vidal\AppData\Roaming\npm\eta-flash-tool -> C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\build\cli\eta-flash-tool\flashtool.js

@serialport/bindings@8.0.8 install C:\Users\vidal\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.15.5 runtime=node arch=x64 libc= platform=win32)

C:\Users\vidal\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 )
gyp ERR! find VS
gyp ERR! find VS msvs_version not set from command line or npm config
gyp ERR! find VS VCINSTALLDIR not set, not running in VS Command Prompt
gyp ERR! find VS could not use PowerShell to find Visual Studio 2017 or newer
gyp ERR! find VS looking for Visual Studio 2015
gyp ERR! find VS - not found
gyp ERR! find VS not looking for VS2013 as it is only supported up to Node.js 8
gyp ERR! find VS
gyp ERR! find VS **************************************************************
gyp ERR! find VS You need to install the latest version of Visual Studio
gyp ERR! find VS including the “Desktop development with C++” workload.
gyp ERR! find VS For more information consult the documentation at:
gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
gyp ERR! find VS **************************************************************
gyp ERR! find VS
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Visual Studio installation to use
gyp ERR! stack at VisualStudioFinder.fail (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:121:47)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:74:16
gyp ERR! stack at VisualStudioFinder.findVisualStudio2013 (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:351:14)
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:70:14
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\find-visualstudio.js:372:16
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:54:7
gyp ERR! stack at C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\util.js:33:16
gyp ERR! stack at ChildProcess.exithandler (child_process.js:315:5)
gyp ERR! stack at ChildProcess.emit (events.js:315:20)
gyp ERR! stack at maybeClose (internal/child_process.js:1048:16)
gyp ERR! System Windows_NT 10.0.19042
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\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules@serialport\bindings
gyp ERR! node -v v14.15.5
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok

sharp@0.27.1 install C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\sharp
(node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)

info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.10.5/libvips-8.10.5-win32-x64.tar.br
info sharp Creating C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\sharp\build\Release
info sharp Copying DLLs from C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\sharp\vendor\8.10.5\lib to C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\sharp\build\Release

serialport@8.0.8 postinstall C:\Users\vidal\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\serialport
node thank-you.js

Thank you for using serialport!
If you rely on this package, please consider supporting our open collective:

https://opencollective.com/serialport/donate

  • edge-impulse-cli@1.12.1
    added 313 packages from 385 contributors in 61.833s

Hi,
I was facing the same too…You need to install the latest version of Visual Studio (not from Microsoft Store) and then install it with selecting the latest C++ Desktop redistributables and then again install edge-impulse-cli from the beginning. It will surely work now! :slight_smile:

Thanks
Arijit

2 Likes

Hi @Vidal,

The serialport package within the CLI requires to be built from sources and needs C++ building tools.
As mentioned by Arijit you could install Visual Studio but it’s a bit heavy.
A quick alternative is to install the “Additional Tools for Node.js”, you can find them in the Windows menu -> Node.js.

image

Once it is done uninstall and reinstall the CLI:

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

I’ll also update the documentation regarding the Node.js additional tools.

Aurelien

Hi Arijit and Aurelien

I was installing VS2019 when I read the Aurelien suggestion

Well, I did both, and now it looks ok.

I do not know what solution worked, but the important is that now I can nove on.

Thank you very much to both

Vidal

3 Likes

Glad it worked out! :slight_smile:

Hello! I am having difficulties with the npm install -g edge-impulse-cli part of the installation. I was wondering if someone could please advise? I have attached a screenshot.

Thank you in advance!

@Drew1 do you have python symlinked to a Python 3 instance by any chance? Looks like a Python 2/3 error (there’s some Python 2 dependency down in our stack…):

E.g. this is for me on macOS:

$ python --version
Python 2.7.16

$ python3 --version
Python 3.8.6

Thank you very much for the quick reply! I have Python 3 (please see attached screen capture).

Hi @Drew1, so I think that’s where this goes wrong. Could you symlink python to python2 for the installation? I’m pretty sure it will go through.

$ rm /usr/local/bin/python
$ ln -s $(which python2) /usr/local/bin/python2

Then can swap this back after installation.

for CLI installation in windows did we have to use windows power shell. also I have visual studio installed using visual community and additional package of node.js i.e. chocolatey but still I am facing the same issue.

@jenny Any suggestions here?

Hello @apoorv,

Could you try opening your powershell or command prompt as administrator and see if that works?

Regards,

Louis

@louis I wanted to know whether an application would be installed in the start menu or not because when I installed it, it is only showing that some files are installed in ‘c’ drive but no application of name edge impulse is showing in the start menu. I am confused about it.

Hello @apoorv,

It looks like your installation was successful, the CLI tools won’t show up in the start menu since they are Command Line Interface tools. It will be used as a gloabl npm package accessible directly from a terminal.

Regards,

Louis

1 Like

BTW, I just tried to do a fresh install using:

And I used Power Shell as Administrator.

PS C:\Windows\system32> nvm list available

|   CURRENT    |     LTS      |  OLD STABLE  | OLD UNSTABLE |                                                          
|--------------|--------------|--------------|--------------|                                                          
|    16.3.0    |   14.17.1    |   0.12.18    |   0.11.16    |                                                           
|    16.2.0    |   14.17.0    |   0.12.17    |   0.11.15    |                                                           
|    16.1.0    |   14.16.1    |   0.12.16    |   0.11.14    |
|    16.0.0    |   14.16.0    |   0.12.15    |   0.11.13    |
|   15.14.0    |   14.15.5    |   0.12.14    |   0.11.12    |
|   15.13.0    |   14.15.4    |   0.12.13    |   0.11.11    |
|   15.12.0    |   14.15.3    |   0.12.12    |   0.11.10    |
|   15.11.0    |   14.15.2    |   0.12.11    |    0.11.9    |
|   15.10.0    |   14.15.1    |   0.12.10    |    0.11.8    |
|    15.9.0    |   14.15.0    |    0.12.9    |    0.11.7    |
|    15.8.0    |   12.22.1    |    0.12.8    |    0.11.6    |
|    15.7.0    |   12.22.0    |    0.12.7    |    0.11.5    |
|    15.6.0    |   12.21.0    |    0.12.6    |    0.11.4    |
|    15.5.1    |   12.20.2    |    0.12.5    |    0.11.3    |
|    15.5.0    |   12.20.1    |    0.12.4    |    0.11.2    |
|    15.4.0    |   12.20.0    |    0.12.3    |    0.11.1    |
|    15.3.0    |   12.19.1    |    0.12.2    |    0.11.0    |
|    15.2.1    |   12.19.0    |    0.12.1    |    0.9.12    |
|    15.2.0    |   12.18.4    |    0.12.0    |    0.9.11    |
|    15.1.0    |   12.18.3    |   0.10.48    |    0.9.10    |

This is a partial list. For a complete list, visit https://nodejs.org/download/release
PS C:\Windows\system32> nvm install latest
Downloading node.js version 16.3.0 (64-bit)...
Complete
Creating C:\Users\luisomoreau\AppData\Roaming\nvm\temp

Downloading npm version 7.15.1... Complete
Installing npm v7.15.1...

Installation complete. If you want to use this version, type

nvm use 16.3.0
PS C:\Windows\system32> nvm use 16.3.0
Now using node v16.3.0 (64-bit)

Then I tried to install the CLI but go an error:

PS C:\Users\luisomoreau> npm install -g edge-impulse-cli --force
...
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS You need to install the latest version of Visual Studio
npm ERR! gyp ERR! find VS including the "Desktop development with C++" workload.
npm ERR! gyp ERR! find VS For more information consult the documentation at:
npm ERR! gyp ERR! find VS https://github.com/nodejs/node-gyp#on-windows
npm ERR! gyp ERR! find VS **************************************************************
npm ERR! gyp ERR! find VS
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: Could not find any Visual Studio installation to use
...

Following the link provided in the error https://github.com/nodejs/node-gyp#on-windows, I downloaded the Visual Studio Community to install the Desktop development with C++ workload:

And finally, I successfully installed Edge Impulse CLI:

PS C:\Users\luisomoreau> 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 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 https://v8.dev/blog/math-random for details.                                                                                                                                               
npm WARN deprecated request@2.88.2: request has been deprecated, see https://github.com/request/request/issues/3142                                                                                                                                                                                                                                                       
added 295 packages, and audited 297 packages in 28s

2 low severity vulnerabilities

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

Run `npm audit` for details.

And now I can use any of Edge Impulse CLI tools.

I hope this can help for those who still have troubles installing the CLI on Windows. Note that it is a bit overkill to install visual studio community to install node-gyp, I haven’t tried @aurel suggestion as I wasn’t sure it was provided with nvm but it should worth giving it a try.

Regards,

Louis

1 Like

@louis Is edge impulse only applicable for devices mentioned in the document file or it can also run in stm32F446RE.

@apoorv,

This question is not really related to edge-impulse-cli installation I guess. I suggest you to create another thread for questions not related to this topic.

But to answer you very quickly, we are hardware agnostic although we do fully support several boards / eval kits but you can always download the C++ libraries, the tflite files, after you trained your model, and use the data-forwarder (or the API, the upload portals, etc…) to ingest your data.

So yes, it will be able to run on the stm32F446RE.

Regards,

Louis

i have the same trouble. I dont know why Visual Studio 2022 install Build Tools 2017, the
npm install --global --production windows-build-tools was crash and hang.

With VS Build Tools 2017 and npm config set msvs_version 2017 the install was successful.


Hello @RickorDD,

Glad you make it work with VS Build Tools 2017 and npm config set msvs_version 2017! Good to know for the community. Thanks for sharing!

Regards,

Louis

When installing edge-impulse-cli I get these messages, I’ve tried several paths and I still haven’t got a solution, can someone help me?