Open weifu6 opened 3 weeks ago
Did you
npm run compile
first?
If so, then what error message are you getting, or what is going wrong when you try to make the components? You don't give enough information to begin to diagnose you situation.
I had run "npm run compile" first,my step is:
npm install
npm run compile
npm run make-components
my error is:
D:\git\mathjax>npm run make-components
> mathjax-full@3.2.2 premake-components
> npm run --silent clean:es5 && npm run --silent clean:lib
> mathjax-full@3.2.2 make-components
> cd components && node bin/makeAll src
Building \src\a11y\assistive-mml
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'D:\git\mathjax\components\src\a11y\assistive-mml\'D:\git\mathjax\components\bin\build''
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.0
Command failed: node 'D:\git\mathjax\components\bin\build'
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'D:\git\mathjax\components\src\a11y\assistive-mml\'D:\git\mathjax\components\bin\build''
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.0
Building \src\a11y\complexity
node:internal/modules/cjs/loader:1146
throw err;
^
Error: Cannot find module 'D:\git\mathjax\components\src\a11y\complexity\'D:\git\mathjax\components\bin\build''
at Module._resolveFilename (node:internal/modules/cjs/loader:1143:15)
at Module._load (node:internal/modules/cjs/loader:984:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:135:12)
at node:internal/main/run_main_module:28:49 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Node.js v20.12.0
Command failed: node 'D:\git\mathjax\components\bin\build'
node:internal/modules/cjs/loader:1146
throw err;
...
I'm curious about why you are rebuilding the MathJax files; are you modifying the MathJax source code? If not, then mathjax-full
comes with everything already compiled and the components made, so there is no need to do that yourself.
I see that you are running in a Windows shell. The build tools were designed for unix, and we haven't done any testing on Windows, so yeah, things go wrong there.
I've managed to get it to work on Windows by making the following changes:
In the package.json
file:
| grep --line-buffered 'Building\\|Webpacking\\|Copying\\|npx'
from line 42.In the components\bin\build
file:
\/
to \\
in the dir.replace()
call..replace(/\\/g, '/')
after the GLOBAL
to get ${GLOBAL.replace(/\\/g, '/')}
..replace(/\\/g, '/')
after the VERSION
to get ${VERSION.replace(/\\/g, '/')}
..replace(/\\/g, '/')
just before the final semicolon.In the components\bin\makeAll
file:
'
) to double quotes ("
) in all three lines.In the components\bin\pack
file:
, {shell: true}
before the final );
, making it
const child = spawn('npx', ['webpack', '--json'], {shell: true});
In the components\src\output\chtml\webpack.config.json
file:
const path = require('path');
at the top of the file. resource.request = path.join(__dirname, 'nofont.js');
Make the same changes to components\src\output\svg\webpack.config.json
.
That should allow you to perform the npm run -s make-components
command, unless I have missed something that I changed. Let me know if you continue to have problems. There will be a lot of output without the grep
command, but it should at least run.
Thank you very much for your patience. It works fine now.
I want to build this project on my computer, I installed all the dependencies, tried to run “npm run make-components”, but there is no way to build it correctly.