NPM/PreFigure in PreText using Visual Studio on Windows

25 views
Skip to first unread message

Teresa “Terri” Magnus

unread,
Jun 13, 2025, 11:24:12 AMJun 13
to PreTeXt support
I have a Windows issue that was not resolved during yesterday's office hours despite a valiant attempt. It was recommended that I post here. We installed PreFigure and NPM but could not get npm to be recognized inside a PreText build even though the command npm --version in the terminal gives 10.9.2.

When I view the built document using the desktop version, I see the Diagram Keyboard Controls but no image.

Working in the github cloud instead, the PreFigure diagram is visible by building and viewing so the PreTeXt/PreFigure code is fine. I'm more comfortable working on my machine though and occasionally work offline. As a side note, with all the uninstalls, installs, and updates, I lost the shortcut to PreTeXt build/view/deploy commands in the cloud and now have to use the terminal.

TIA-Terri

David Austin

unread,
Jun 13, 2025, 11:43:57 AMJun 13
to pretext...@googlegroups.com
Thanks for this report, Terri.  Sorry I wasn't able to attend yesterday's drop-in.  Would you be able to attend on Monday so that we could troubleshoot together?  I feel like having a back-and-forth over email would probably cover a lot of ground you already covered yesterday.

In the meantime, could you check that node is installed with "node --version" in a terminal?  I'm not as familiar with npm/node in windows installations.

Thanks again,
David

--
You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/90083326-c20e-41d8-b084-974b544b34d7n%40googlegroups.com.

Sean Fitzpatrick

unread,
Jun 13, 2025, 11:44:31 AMJun 13
to pretext...@googlegroups.com

I found node/npm to be the hardest part about doing things on Windows.

Things I would try (but you probably already have):

- check the Windows environment variables to make sure paths are set correctly

- try using Git Bash instead of a Windows terminal


--

Teresa Magnus

unread,
Jun 13, 2025, 11:51:03 AMJun 13
to pretext...@googlegroups.com
Node 22.16.0 is installed. Monday would be great! I may have created more of a mess after the office hours. Now I'm seeing no output when I build.

Thank you!
Terri

--
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/PkSgBdyaURc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.

To view this discussion visit

David Austin

unread,
Jun 13, 2025, 11:55:07 AMJun 13
to pretext...@googlegroups.com
I suspect that Sean's suggestions are helpful, but maybe you checked that in yesterday's drop-in.  In any case, I'll see you Monday and we'll get things straightened out!

David

Teresa Magnus

unread,
Jun 13, 2025, 12:01:07 PMJun 13
to pretext...@googlegroups.com
They might be helpful to someone who knows more about the workings of the computer than I do. My son might help me with some of the non-PreTeXt- specific items this weekend, but otherwise I'll wait until Monday. We probably checked some of it at some point but may need to revisit it.

--
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/PkSgBdyaURc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.

Teresa Magnus

unread,
Jun 13, 2025, 3:31:48 PMJun 13
to 'Teresa Magnus' via PreTeXt support
This message may help troubleshoot:
node:internal/modules/cjs/loader:1404
throw err:

Error: Cannot find module 'mathjax-full/js/util/asyncLoad/node.js'
Require stack:
- C:\Users\three\AppData\Local\Programs\Python\Python311\Lib\site-packages\prefig\core\mj_sre\mj-sre-page.js
    at Function._resolveFilename (node:internal/modules/cjs/loader:1401:15)
    at defaultResolveImpl (node:internal/modules/cjs/loader:1057:19)
    at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1062:22)
    at Function._load (node:internal/modules/cjs/loader:1211:37)
    at TracingChannel.traceSync (node:diagnostics_channel:322:14)
    at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
    at Module.require (node:internal/modules/cjs/loader:1487:12)
    at require (node:internal/modules/helpers:135:16)
    at Object.<anonymous> (C:\Users\three\AppData\Local\Programs\Python\Python311\Lib\site-packages\prefig\core\mj_sre\mj-sre-page.js:34:1)
    at Module._compile (node:internal/modules/cjs/loader:1730:14) {
  code: 'MODULE_NOT_FOUND',
  requireStack: [
    'C:\\Users\\three\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\prefig\\core\\mj_sre\\mj-sre-page.js'
  ]


David Austin

unread,
Jun 13, 2025, 3:37:13 PMJun 13
to pretext...@googlegroups.com
OK, that's helpful.  It looks like MathJax wasn't installed.  Is there a folder called "node-modules" in the folder C:\\Users\\three\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\prefig\\core\\mj_sre\\?

Teresa Magnus

unread,
Jun 13, 2025, 4:17:17 PMJun 13
to pretext...@googlegroups.com
No, only mj-sre-page.js and package.json.

On Friday, June 13, 2025 at 03:37:17 PM EDT, David Austin <david.a...@gmail.com> wrote:


OK, that's helpful.  It looks like MathJax wasn't installed.  Is there a folder called "node-modules" in the folder C:\\Users\\three\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\prefig\\core\\mj_sre\\?

--
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/PkSgBdyaURc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit

David Austin

unread,
Jun 13, 2025, 4:24:27 PMJun 13
to pretext...@googlegroups.com
OK, try this.  From the terminal, give these commands

cd C:\\Users\\three\\AppData\\Local\\Programs\\Python\\Python311\\Lib\\site-packages\\prefig\\core\\mj_sre\\
npm install

After a few seconds, you should have node-modules in that folder.  Then try compiling a PreFigure diagram again.

You received this message because you are subscribed to the Google Groups "PreTeXt support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to pretext-suppo...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/pretext-support/1475612882.340579.1749845831249%40mail.yahoo.com.

Teresa Magnus

unread,
Jun 13, 2025, 4:44:33 PMJun 13
to pretext...@googlegroups.com
Success! Thank you!

--
You received this message because you are subscribed to a topic in the Google Groups "PreTeXt support" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/pretext-support/PkSgBdyaURc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to pretext-suppo...@googlegroups.com.

David Austin

unread,
Jun 13, 2025, 4:51:01 PMJun 13
to pretext...@googlegroups.com
Thanks for your patience, Terri.  Your report is really helpful to me.

David

Reply all
Reply to author
Forward
0 new messages