Error While installing edge-impulse-cli on windows - Visual Studio 2019

Steps:
Command Prompt As Administrator
C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build\vcvars64
npm install --global --production windows-build-tools
npm config set msvs_version 2019 --global
npm install -g edge-impulse-cli

I’ve done the whole uninstall/re-install thing, twice.

Here are the error messages:
gyp ERR! find VS
gyp ERR! find VS msvs_version was set from command line or npm config
gyp ERR! find VS - looking for Visual Studio version 2019
gyp ERR! find VS running in VS Command Prompt, installation path is:
gyp ERR! find VS “C:\Program Files (x86)\Microsoft Visual Studio\2019\Community”
gyp ERR! find VS - will only use this version
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 msvs_version does not match this VS Command Prompt or the
gyp ERR! find VS installation cannot be used.
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.19043
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\johne\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules@serialport\bindings
gyp ERR! node -v v14.16.0
gyp ERR! node-gyp -v v5.1.0
gyp ERR! not ok
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:

I’ve checked the log file but can’t find anything obvious.
Thanks very much for any suggestions.
John

Hi John,

It looks like Node.js components are missing.
Can you install the Additional Node.js tools? You should find an entry in the Windows menu. Otherwise just reinstall Node and select additional Node.js tools when prompted.

Aurelien

Thanks Aurel,
I reinstalled the Additional Node.js tools to make sure.
I also made sure I updated Visual Studio (2019) via Visual Studio Installer.
I still get the same problem.
Best, John

Hi @johned,

Sorry for the late reply. Just to confirm, do you have Python 2.x installed? The serialport package shows an error, it requires Python 2.x to be compiled via node-gyp.

Aurelien

Thanks Aurelien,
That could be right.
If I get some bandwidth I’ll re-install Python 2 and update this thread.
Given that Python 2 is deprecated,EI should probably list it in the dependencies, in the documentation: https://docs.edgeimpulse.com/docs/silabs-thunderboard-sense-2.
Best,
J

Hi @johned, so if you upgrade to Node.js 14 the Python 2 dependency should now be gone. We’ve updated the docs accordingly.

Thanks @janjongboom.
I uninstalled edge-impulse-cli, all Python installations and Node.js.
Followed the instructions for “Installation - macOS and Windows” here: https://docs.edgeimpulse.com/docs/cli-installation
Unfortunately I still get the same error.
Best,
John

Hi @johned,

I have recently started working on installation scripts for Mac/Windows/Linux to install the Edge Impulse CLI and it’s dependencies. I have a Windows script working here: https://github.com/edgeimpulse/ei-install-scripts It uses the package manager “chocolatey” to install Python 2/3, Node/npm, and the CLI. Can you please uninstall your existing Python/Node/npm installations and give that script a go?

Thanks!
Jenny

1 Like

As an aside, please ensure the following directories are gone after uninstalling your existing npm installation:

C:\Program Files (x86)\Nodejs
C:\Program Files\Nodejs
C:\Users\{User}\AppData\Roaming\npm (or %appdata%\npm)
C:\Users\{User}\AppData\Roaming\npm-cache (or %appdata%\npm-cache)
C:\Users\{User}\.npmrc (and possibly check for that without the . prefix too)
C:\Users\{User}\AppData\Local\Temp\npm-*

Also, my Windows computer does not have Visual Studio installed on it at all

Hi Jenny,
Thank you very much for your responses.
I did everything you said, including removing the folders.
When I ran your script (as administrator) it failed to install node.
I tried to start from scratch (as per your instructions) but now I can no longer see node but the script is reporting it is installed:
.\install-windows.ps1
Chocolatey version = 0.10.15
ERROR: Python 2 cannot be found.
If Python 2 is already installed, check that it is in your PATH.
Install Python 2 with Chocolatey? [yes/no]: yes
Installing Python 2…
Chocolatey v0.10.15
Installing the following packages:
python2
By installing you accept licenses for the packages.
python2 v2.7.18 already installed.
Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Warnings:

  • python2 - python2 v2.7.18 already installed.
    Use --force to reinstall, specify a version to install, or try upgrade.
    Python 3 version = Python 3.8.8
    ERROR: Node.js cannot be found.
    If Node.js is already installed, check that it is in your PATH.
    Install Node.js & npm with Chocolatey? [yes/no]: yes
    Installing Node.js & npm…
    Chocolatey v0.10.15
    Installing the following packages:
    nodejs.install
    By installing you accept licenses for the packages.
    nodejs.install v15.13.0 already installed.
    Use --force to reinstall, specify a version to install, or try upgrade.

Chocolatey installed 0/1 packages.
See the log for details (C:\ProgramData\chocolatey\logs\chocolatey.log).

Warnings:

  • nodejs.install - nodejs.install v15.13.0 already installed.
    Use --force to reinstall, specify a version to install, or try upgrade.
    ERROR: Re-run this script and install Node.js & npm.
    Run ‘refreshenv’ and close/reopen a new administrator PowerShell terminal to see installation changes.
    PS C:\Users\johne\Desktop\EI_Install\ei-install-scripts>

I’ve moved onto a new project now so I will not be working on this.
Good luck with your script.
Best regards,
John

1 Like

Interesting that it finds Node.js but thinks it’s not installed. Thanks for posting your output, and good luck with your new project!

I am not sure if this is of any help but I can see in your errors its indicating you need the C++ workloads installed. Have you tried to run Visual Studio’s installer and install the C++ dev tools? Thats usually quite a big download though if you have bandwidth issues.

Also watchout for when the “python” command is symlinked to the python3 interpreter that has tripped me up a few times on other projects that were expecting python2.

It might be better to do this completely outside of Visual Studio and use VSCode rather if you ever do pick this up again. It works no problem when you install directly from the normal windows command prompt.