markbind icon indicating copy to clipboard operation
markbind copied to clipboard

Document: Node LTS (v20) and python 3.12 does not work on MarkBind install

Open kaixin-hc opened this issue 10 months ago • 4 comments

Please confirm that you have searched existing issues in the repo

Yes, I have searched the existing issues

Any related issues?

No response

Tell us about your environment

M2 Mac v13.6.6

MarkBind version

5.4.0

Describe the bug and the steps to reproduce it

When running npm install in the root of markbind, see the following error: node-gyp error

This error is caused because 3.12 python deprecates distutils, and node-gyp packaged with LTS is a node-gyp version before version 10. As stated in this issue, python 3.12 needs the newer version of node-gyp. It seems non trivial to update node-gyp version, as the official instructions here did not work for me (needs more testing).

However, one workaround that worked for me was adding the following line to node config python=path/to/python/on/my/device and downgrading my python version (brew uninstall [email protected] - though i had to force uninstall it due to dependencies)

(I also had to delete and reclone my MarkBind, but I suspect that was unrelated)

Expected behavior

If the versions are not supported, we should maybe warn users of the problem since right now we just say the following about required version... Screenshot 2024-04-04 at 4 34 54 PM

Anything else?

Thank you @lhw-1 and @EltonGohJH for your extensive help troubleshooting this issue!

kaixin-hc avatar Apr 04 '24 08:04 kaixin-hc

I also run into the same issue this morning;

The cause is that "distutils package is removed in python version 3.12"

yiwen101 avatar Apr 08 '24 04:04 yiwen101

I've also faced this issue before and this helped: https://stackoverflow.com/questions/77251296/distutils-not-found-when-running-npm-install , if many people also encounter the same issue as me maybe it'll be good to add a note in the devdocs regarding this

jingting1412 avatar Apr 08 '24 04:04 jingting1412

I've also faced this issue before and this helped: https://stackoverflow.com/questions/77251296/distutils-not-found-when-running-npm-install , if many people also encounter the same issue as me maybe it'll be good to add a note in the devdocs regarding this

Thank you for the valuable input!

Additional note: For system with python3 installed via brew, running brew install python-setuptools can also solve the issue. Running python3 -m pip install setuptools may run intoerror: externally-managed-environment

yiwen101 avatar Apr 08 '24 05:04 yiwen101

As this is now linked in our documentation, lets leave this open until we can remove the warning from our documentation.

kaixin-hc avatar Apr 28 '24 14:04 kaixin-hc