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

1 Like

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.