MarkBind / markbind

MarkBind is a tool for generating content-heavy websites from source files in Markdown format
https://markbind.org/
MIT License
134 stars 123 forks source link

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

Open kaixin-hc opened 3 months ago

kaixin-hc commented 3 months ago

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 python@3.12 - 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!

yiwen101 commented 3 months ago

I also run into the same issue this morning;

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

jingting1412 commented 3 months ago

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

yiwen101 commented 3 months ago

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

kaixin-hc commented 2 months ago

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