mathjax-node-cli
mathjax-node-cli copied to clipboard
This package is broken under current versions of Node
This is because it uses an unbounded version of yargs in package.json, but yargs v18+ removes .demand which this package relies on. Need to bind yargs to <v18
$ tex2svg
/usr/lib/node_modules/mathjax-node-cli/bin/tex2svg:29
.demand(1).strict()
^
TypeError: require(...).demand is not a function
at Object.<anonymous> (/usr/lib/node_modules/mathjax-node-cli/bin/tex2svg:29:4)
at Module._compile (node:internal/modules/cjs/loader:1692:14)
at Object..js (node:internal/modules/cjs/loader:1824:10)
at Module.load (node:internal/modules/cjs/loader:1427:32)
at Module._load (node:internal/modules/cjs/loader:1250:12)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:152:5)
at node:internal/main/run_main_module:33:47
Node.js v24.3.0
I solved this by adding the following to my package.json:
"overrides": {
"mathjax-node-cli": {
"yargs": "^17.6.2"
}
}