Build errors

4 views
Skip to first unread message

Scott Bloom

unread,
Oct 1, 2025, 4:41:27 PM (2 days ago) Oct 1
to MathJax Users
Following the build documentation at https://docs.mathjax.org/en/latest/web/hosting.html#obtain-mathjax

Im getting the following error when running pnpm build (or any of the build scripts)

$ pnpm build

> @mathjax/s...@4.0.0 build C:\Users\scott.TOWEL42\Dropbox\home\mathjax
> pnpm -s build-mjs

'log' is not recognized as an internal or external command,
operable program or batch file.

Ive installed the package log via npm install -g log, but that doesnt help.

Any help will be most appreciated.

Thanks
Scott

Davide Cervone

unread,
9:53 AM (6 hours ago) 9:53 AM
to mathja...@googlegroups.com
Scott:

Neither of the developers use Windows, so we don't do much testing of the build process there.  The error you are getting is because the MathJax package scripts expect to run in the bash shell, not the Windows command shell.  You can tell pnpm to use bash via the command:

npm config set script-shell "C:\\Program Files\\Git\\bin\\bash.exe"

provided you have git installed (which I presume you do, if you are building MathJax from source).

Note, however, that there will still be problems, as the build scripts have other problems with Windows.  As usual, the fact that Windows uses backslashes for directory separators, while everyone else uses forward slashes is one of the sources of issues, but also executing system commands requires special handling in node on Windows.

I spent some time working out the details, and provide the attached patch file that you should be able to apply to your cloned MathJax repository.  It should make the build tools work for you in the Windows shell (provided the file makes it through Google's filtering to this forum post; if not, I'll make a new post with the test of the patch).

Alternatively, you could use Windows Subsystem for Linux (WSL), or Cygwin or something similar, which should let you use the build process as is.

Also, I'm not sure why you need to rebuild MathJax, as the @mathjax/src node package already includes the compiled and bundled versions, and if you want to make change to MathJax, it is probably better to subclass the needed parts and use this subclasses rather than editing the MathJax source directly.

In any case, here's the patch.

Davide

windows.patch
Reply all
Reply to author
Forward
0 new messages