# Failure to install the node-red-contrib-midi palette

**URL:** <https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554>\
**Category:** General\
**Created:** [9 December 2023 11:27 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554 "2023-12-09T11:27:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Escapop](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Escapop](https://discourse.nodered.org/u/Escapop)\
**Post date:** [9 December 2023 11:27 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/1 "2023-12-09T11:27:56Z")

</div>

Hello everyone,  
Sorry to open a new topic, it is the first time I use the forum as I have not been able to find the solution to my problem.

I want to use Midi on my Node-red, the node-red-contrib-midi palette works fine on the Mac but on Windows I can't get it installed.

the first errors told me to install Python and Visual Basic, that's done.

But it still won't install.  
I seem to understand in the log that something called "distutils" is missing. What is it and how do I fix it in Windows? Is it a versioning problem? Does anyone have a solution that can share with me?  
I really appreciate it!  
Thank you very much for your help.

LOG:

```auto
2023-12-09T11:25:45.019Z Install : node-red-contrib-midi 1.1.2

2023-12-09T11:25:45.028Z npm.cmd install --no-audit --no-update-notifier --no-fund --save --save-prefix=~ --production --engine-strict node-red-contrib-midi@1.1.2
2023-12-09T11:25:47.294Z [err] npm
2023-12-09T11:25:47.294Z [err] WARN config production Use `--omit=dev` instead.
2023-12-09T11:25:54.623Z [err] npm
2023-12-09T11:25:54.623Z [err] ERR! code 1
2023-12-09T11:25:54.623Z [err] npm 
2023-12-09T11:25:54.623Z [err] ERR!
2023-12-09T11:25:54.623Z [err] path
2023-12-09T11:25:54.623Z [err] C:\Users\escap\.node-red\node_modules\midi
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] command failed
2023-12-09T11:25:54.625Z [err] npm ERR! command C:\Windows\system32\cmd.exe /d /s /c node-gyp rebuild
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info it worked if it ends with ok
2023-12-09T11:25:54.625Z [err] npm 
2023-12-09T11:25:54.625Z [err] ERR! gyp info using node-gyp@9.4.0
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info using node@20.9.0 | win32 | x64
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info find Python using Python version 3.12.0 found at "C:\Users\escap\AppData\Local\Programs\Python\Python312\python.exe"
2023-12-09T11:25:54.625Z [err] npm 
2023-12-09T11:25:54.625Z [err] ERR! gyp info find VS using VS2022 (17.8.34322.80) found at:
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info find VS "C:\Program Files\Microsoft Visual Studio\2022\Community"
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info find VS run with --verbose for detailed information
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn C:\Users\escap\AppData\Local\Programs\Python\Python312\python.exe
2023-12-09T11:25:54.625Z [err] npm
2023-12-09T11:25:54.625Z [err] ERR! gyp info spawn args [
2023-12-09T11:25:54.625Z [err] npm 
2023-12-09T11:25:54.625Z [err] ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\gyp\\gyp_main.py',
2023-12-09T11:25:54.625Z [err] npm 
2023-12-09T11:25:54.625Z [err] ERR! gyp info spawn args 'binding.gyp',
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info spawn args '-f',
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info spawn args 'msvs',
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info spawn args '-I',
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info spawn args 'C:\\Users\\escap\\.node-red\\node_modules\\midi\\build\\config.gypi',
2023-12-09T11:25:54.625Z [err] npm ERR!
2023-12-09T11:25:54.625Z [err] gyp info spawn args '-I',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args 'C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp\\addon.gypi',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args '-I',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args 'C:\\Users\\escap\\AppData\\Local\\node-gyp\\Cache\\20.9.0\\include\\node\\common.gypi',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args '-Dlibrary=shared_library',
2023-12-09T11:25:54.625Z [err] npm
2023-12-09T11:25:54.625Z [err] ERR! gyp info spawn args '-Dvisibility=default',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args '-Dnode_root_dir=C:\\Users\\escap\\AppData\\Local\\node-gyp\\Cache\\20.9.0',
2023-12-09T11:25:54.625Z [err] npm
2023-12-09T11:25:54.625Z [err] ERR! gyp info spawn args '-Dnode_gyp_dir=C:\\Program Files\\nodejs\\node_modules\\npm\\node_modules\\node-gyp',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args '-Dnode_lib_file=C:\\\\Users\\\\escap\\\\AppData\\\\Local\\\\node-gyp\\\\Cache\\\\20.9.0\\\\<(target_arch)\\\\node.lib',
2023-12-09T11:25:54.625Z [err] npm ERR! gyp info spawn args '-Dmodule_root_dir=C:\\Users\\escap\\.node-red\\node_modules\\midi',
2023-12-09T11:25:54.626Z [err] npm ERR! gyp info spawn args '-Dnode_engine=v8',
2023-12-09T11:25:54.626Z [err] npm ERR! gyp info spawn args '--depth=.',
2023-12-09T11:25:54.626Z [err] npm ERR! gyp info spawn args '--no-parallel',
2023-12-09T11:25:54.626Z [err] npm ERR!
2023-12-09T11:25:54.626Z [err] gyp info spawn args '--generator-output',
2023-12-09T11:25:54.626Z [err] npm ERR! gyp info spawn args 'C:\\Users\\escap\\.node-red\\node_modules\\midi\\build',
2023-12-09T11:25:54.626Z [err] npm ERR!
2023-12-09T11:25:54.626Z [err] gyp info spawn args '-Goutput_dir=.'
2023-12-09T11:25:54.626Z [err] npm ERR! gyp info spawn args ]
2023-12-09T11:25:54.626Z [err] npm 
2023-12-09T11:25:54.626Z [err] ERR! Traceback (most recent call last):
2023-12-09T11:25:54.626Z [err] npm ERR! File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\gyp_main.py", line 42, in <module>
2023-12-09T11:25:54.626Z [err] npm
2023-12-09T11:25:54.626Z [err] ERR! import gyp # noqa: E402
2023-12-09T11:25:54.626Z [err] npm ERR! ^^^^^^^^^^
2023-12-09T11:25:54.626Z [err] npm ERR! File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\ __init__.py", line 9, in <module>
2023-12-09T11:25:54.626Z [err] npm ERR!
2023-12-09T11:25:54.626Z [err] import gyp.input
2023-12-09T11:25:54.626Z [err] npm ERR! File "C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\gyp\pylib\gyp\input.py", line 19, in <module>
2023-12-09T11:25:54.626Z [err] npm 
2023-12-09T11:25:54.626Z [err] ERR! from distutils.version import StrictVersion
2023-12-09T11:25:54.626Z [err] npm ERR! ModuleNotFoundError: No module named 'distutils'
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! configure error 
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! stack Error: `gyp` failed with exit code: 1
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! stack at ChildProcess.onCpExit (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:325:16)
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! stack at ChildProcess.emit (node:events:514:28)
2023-12-09T11:25:54.626Z [err] npm
2023-12-09T11:25:54.626Z [err] ERR! gyp ERR! stack at ChildProcess._handle.onexit (node:internal/child_process:294:12)
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! System Windows_NT 10.0.22621
2023-12-09T11:25:54.626Z [err] npm 
2023-12-09T11:25:54.626Z [err] ERR! 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"
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! cwd C:\Users\escap\.node-red\node_modules\midi
2023-12-09T11:25:54.626Z [err] npm ERR!
2023-12-09T11:25:54.626Z [err] gyp ERR! node -v v20.9.0
2023-12-09T11:25:54.626Z [err] npm ERR! gyp ERR! node-gyp -v v9.4.0
2023-12-09T11:25:54.626Z [err] npm
2023-12-09T11:25:54.626Z [err] ERR! gyp ERR! not ok
2023-12-09T11:25:54.628Z [err] 
2023-12-09T11:25:54.628Z [err] npm ERR! A complete log of this run can be found in: C:\Users\escap\AppData\Local\npm-cache\_logs\2023-12-09T11_25_47_225Z-debug-0.log
2023-12-09T11:25:54.651Z rc=1

```

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [9 December 2023 11:42 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/2 "2023-12-09T11:42:35Z")

</div>

@Escapop welcome to the forum!

When I look at an issue with a node, one of the first things is look in the flow library for it. The midi node is here:

> **[node-red-contrib-midi](https://flows.nodered.org/node/node-red-contrib-midi)**
>
> Midi Node

Then I follow the GitHub link

> **[GitHub - urbiworx/node-red-contrib-midi](https://github.com/urbiworx/node-red-contrib-midi)**
>
> Contribute to urbiworx/node-red-contrib-midi development by creating an account on GitHub.

and then look at the opened

> **[Issues · urbiworx/node-red-contrib-midi](https://github.com/urbiworx/node-red-contrib-midi/issues)**
>
> Contribute to urbiworx/node-red-contrib-midi development by creating an account on GitHub.

and closed issues:

> **[Issues · urbiworx/node-red-contrib-midi](https://github.com/urbiworx/node-red-contrib-midi/issues?q=is%3Aissue%2Bis%3Aclosed)**
>
> Contribute to urbiworx/node-red-contrib-midi development by creating an account on GitHub.

Take a look at those issues and see if any of them help.

Just one more thing, the author of that node has not been active on GitHug for over a year so you may not get a response from him.

---

<div class="post-metadata">

**Author:** ![Escapop](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Escapop](https://discourse.nodered.org/u/Escapop)\
**Post date:** [10 December 2023 12:29 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/3 "2023-12-10T12:29:36Z")

</div>

Hi Zenofmud, thank you very much for your quick response. Indeed I had already searched for an answer on Github and forums but I haven't found anything related.

My intuition tells me that the error has more to do with Python versions than with the particular palette. Have you seen the 'distutils' error for a Windows OS before? Would you know how to fix it?

Thank you very much for taking the time to help

---

<div class="post-metadata">

**Author:** ![zenofmud](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/zenofmud/32/316_2.png) [@zenofmud](https://discourse.nodered.org/u/zenofmud)\
**Post date:** [10 December 2023 15:52 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/4 "2023-12-10T15:52:13Z")

</div>

> [@Escapop](#):
>
> Have you seen the 'distutils' error for a Windows OS before? Would you know how to fix it?

Sorry I’m a macOS and raspberry pi user.

You could try opening an issue on the nodes GitHub page or looking at the issues and adding to an existing issue. That way you might get help from someone who posted on that issue.

---

<div class="post-metadata">

**Author:** ![Colin](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/colin/32/17040_2.png) [@Colin](https://discourse.nodered.org/u/Colin)\
**Post date:** [10 December 2023 16:52 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/5 "2023-12-10T16:52:47Z")

</div>

This looks as if it may be the problem. There is a suggested workaround there.

> <https://github.com/nodejs/node-gyp/issues/2869>
>
> \[distutils\](https://docs.python.org/3/library/distutils.html#module-distutils) i…s deprecated with removal planned for Python 3.12. See the \[What’s New\](https://docs.python.org/3/whatsnew/3.10.html#distutils-deprecated) entry for more information.
> 
> Our only current use of \[Python \`distutils\`\](https://docs.python.org/3/library/distutils.html) is at:
> https://github.com/nodejs/node-gyp/blob/33391db3a0008eff8408890da6ab232f2f90fcab/gyp/pylib/gyp/input.py#L19
> https://github.com/nodejs/node-gyp/blob/33391db3a0008eff8408890da6ab232f2f90fcab/gyp/pylib/gyp/input.py#L1186
> 
> As discussed in https://stackoverflow.com/questions/11887762, we should replace \`distutils.version.StrictVersion\` with \[\`packaging.version.parse\`\](https://packaging.pypa.io/en/latest/version.html#packaging.version.parse).

---

<div class="post-metadata">

**Author:** ![Escapop](https://avatars.discourse-cdn.com/v4/letter/e/8e8cbc/32.png) [@Escapop](https://discourse.nodered.org/u/Escapop)\
**Post date:** [13 December 2023 13:03 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/6 "2023-12-13T13:03:20Z")

</div>

Yes I had read all these forums but I couldn't find a solution, so I thought I'd go simple and look for an older version of python, I used version 3.10 and it worked!

Thanks to all of you

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex026/uploads/nodered/original/1X/d073cd938eafa2e558d7c2cd59003b3ef4963033.png) [@system](https://discourse.nodered.org/u/system)\
**Post date:** [11 February 2024 13:04 UTC](https://discourse.nodered.org/t/failure-to-install-the-node-red-contrib-midi-palette/83554/7 "2024-02-11T13:04:08Z")

</div>

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.
