Edge Impulse Cli error in install on Windows

Hi all,
I tried to uninstall and reinstall Python,Node js (with addon) etc. but when i call
C:\WINDOWS\system32>npm install -g edge-impulse-cli --force
I receive this list of error:

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.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 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. (https://github.com/visionmedia/debug/issues/797)
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. (https://github.com/visionmedia/debug/issues/797)
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. (https://github.com/visionmedia/debug/issues/797)
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.0: request has been deprecated, see https://github.com/request/request/issues/3142
npm WARN cleanup Failed to remove some directories [
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\typescript\loc\lcl'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\typescript\\loc\\lcl'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\tar-stream',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\tar-stream\node_modules'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\tar-stream\\node_modules'
npm WARN cleanup     }
npm WARN cleanup   ],
npm WARN cleanup   [
npm WARN cleanup     'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli',
npm WARN cleanup     [Error: EPERM: operation not permitted, rmdir 'C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\tar-stream'] {
npm WARN cleanup       errno: -4048,
npm WARN cleanup       code: 'EPERM',
npm WARN cleanup       syscall: 'rmdir',
npm WARN cleanup       path: 'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\tar-stream'
npm WARN cleanup     }
npm WARN cleanup   ]
npm WARN cleanup ]
npm ERR! code 1
npm ERR! path C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\@serialport\bindings
npm ERR! command failed
npm ERR! command C:\WINDOWS\system32\cmd.exe /d /s /c prebuild-install --tag-prefix @serialport/bindings@ || node-gyp rebuild
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using node-gyp@9.4.1
npm ERR! gyp info using node@20.9.0 | win32 | x64
npm ERR! gyp info find Python using Python version 3.12.0 found at "C:\Python312\python.exe"
npm ERR! gyp info find VS using VS2019 (16.11.33927.289) found at:
npm ERR! gyp info find VS "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community"
npm ERR! gyp info find VS run with --verbose for detailed information
npm ERR! gyp info spawn C:\Python312\python.exe
npm ERR! gyp info spawn args [
npm ERR! gyp info spawn args   'C:\\Users\\infor\\node_modules\\node-gyp\\gyp\\gyp_main.py',
npm ERR! gyp info spawn args   'binding.gyp',
npm ERR! gyp info spawn args   '-f',
npm ERR! gyp info spawn args   'msvs',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\@serialport\\bindings\\build\\config.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\infor\\node_modules\\node-gyp\\addon.gypi',
npm ERR! gyp info spawn args   '-I',
npm ERR! gyp info spawn args   'C:\\Users\\infor\\AppData\\Local\\node-gyp\\Cache\\20.9.0\\include\\node\\common.gypi',
npm ERR! gyp info spawn args   '-Dlibrary=shared_library',
npm ERR! gyp info spawn args   '-Dvisibility=default',
npm ERR! gyp info spawn args   '-Dnode_root_dir=C:\\Users\\infor\\AppData\\Local\\node-gyp\\Cache\\20.9.0',
npm ERR! gyp info spawn args   '-Dnode_gyp_dir=C:\\Users\\infor\\node_modules\\node-gyp',
npm ERR! gyp info spawn args   '-Dnode_lib_file=C:\\\\Users\\\\infor\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.9.0\\\\<(target_arch)\\\\node.lib',
npm ERR! gyp info spawn args   '-Dmodule_root_dir=C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\@serialport\\bindings',
npm ERR! gyp info spawn args   '-Dnode_engine=v8',
npm ERR! gyp info spawn args   '--depth=.',
npm ERR! gyp info spawn args   '--no-parallel',
npm ERR! gyp info spawn args   '--generator-output',
npm ERR! gyp info spawn args   'C:\\Users\\infor\\AppData\\Roaming\\npm\\node_modules\\edge-impulse-cli\\node_modules\\@serialport\\bindings\\build',
npm ERR! gyp info spawn args   '-Goutput_dir=.'
npm ERR! gyp info spawn args ]
npm ERR! Traceback (most recent call last):
npm ERR!   File "C:\Users\infor\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
npm ERR!     import gyp  # noqa: E402
npm ERR!     ^^^^^^^^^^
npm ERR!   File "C:\Users\infor\node_modules\node-gyp\gyp\pylib\gyp\__init__.py", line 9, in <module>
npm ERR!     import gyp.input
npm ERR!   File "C:\Users\infor\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
npm ERR!     from distutils.version import StrictVersion
npm ERR! ModuleNotFoundError: No module named 'distutils'
npm ERR! gyp ERR! configure error
npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
npm ERR! gyp ERR! stack     at ChildProcess.onCpExit (C:\Users\infor\node_modules\node-gyp\lib\configure.js:325:16)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:514:28)
npm ERR! gyp ERR! stack     at ChildProcess._handle.onexit (node:internal/child_process:294:12)
npm ERR! gyp ERR! System Windows_NT 10.0.19045
npm ERR! gyp ERR! command "C:\\Program Files\\nodejs\\node.exe" "C:\\Users\\infor\\node_modules\\node-gyp\\bin\\node-gyp.js" "rebuild"
npm ERR! gyp ERR! cwd C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\@serialport\bindings
npm ERR! gyp ERR! node -v v20.9.0
npm ERR! gyp ERR! node-gyp -v v9.4.1
npm ERR! gyp ERR! not ok

npm ERR! A complete log of this run can be found in: C:\Users\infor\AppData\Local\npm-cache\_logs\2023-10-28T10_42_11_664Z-debug-0.log

What the message means?:

npm ERR! path C:\Users\infor\AppData\Roaming\npm\node_modules\edge-impulse-cli\node_modules\@serialport\bindings
npm ERR! command failed

???

I have VS2019 and VS2022 installed, username is ‘infor’.
Where can I search the problem?

Thanks in advance

Hi @PaoloFi

As is typical when developing you can ignore the warnings, and focus on the Errors, permissions is the main one. Run as administrator to overcome that.

Check through our forum there are many posts on this:

Best

Eoin

Thank you for your suggestions but I have already read and apply all solutions proposed, the problem is that I don’t understand what the errors means, are path problems or files not found or library release old or deprecated, is a Python error?
Unfortunatly I don’t know npm sysntax.
I tried to install in a virgin VM also with the same result, so I think could be an problem in the installation files that I downloaded.

Paolo

Hi, @PaoloFi
I got the same error as you, see the thread. Try an older version of Python.

Thank you very much, I’ll try it out.

Regards

Paolo

Hi all,

@PaoloFi , @Eoin

I am also facing the exact same (errors) issue while installing edge-impulse-cli. I tried uninstalling the python 3.12 and installing of python 3.9 but still I facing same issue. Can anyone please help me regarding this.

Thank you for your attention.

Warm regards,
Prasanna Vishnu.

Hi @Vishnu210

Welcome to the forum. What is issue you are facing, there are many issues listed here in this thread -

e.g.

EPERM is a permissions issue, if this is what you are getting then you need to try with Admin.

distutils not being found is incorrect installation of Python.

Please share your exact error so we can give steps to try, the troubleshooting in our docs has been updated since this thread too so please create a new post if you have a new error. Thanks!

Best

Eoin