Dynamic substitutions error with CLI 2.23.0

16 views
Skip to first unread message

Sean Fitzpatrick

unread,
Jul 11, 2025, 2:18:46 PM7/11/25
to PreTeXt support
I've just upgraded to CLI 2.23.0, and I'm getting an error with dynamic substitutions that I have not previously encountered while building Runestone:

Generating substitutions.
error: Dynamic substitution process failed: node:internal/modules/esm/resolve:841
error:   throw new ERR_MODULE_NOT_FOUND(packageName, fileURLToPath(base), null);
error:         ^
error:
error: Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'btm-expressions' imported from /home/wwadmin/.ptx/2.23.0/core/script/dynsub/dynamic_extract.mjs
error:     at packageResolve (node:internal/modules/esm/resolve:841:9)
error:     at moduleResolve (node:internal/modules/esm/resolve:914:18)
error:     at defaultResolve (node:internal/modules/esm/resolve:1119:11)
error:     at ModuleLoader.defaultResolve (node:internal/modules/esm/loader:542:12)
error:     at ModuleLoader.resolve (node:internal/modules/esm/loader:511:25)
error:     at ModuleLoader.getModuleJob (node:internal/modules/esm/loader:241:38)
error:     at ModuleJob._link (node:internal/modules/esm/module_job:126:49) {
error:   code: 'ERR_MODULE_NOT_FOUND'
error: }
error:
error: Node.js v22.2.0

Is there an npm install I need to do somewhere?

D. Brian Walton

unread,
Jul 11, 2025, 2:33:50 PM7/11/25
to pretext...@googlegroups.com
Hmm, the CLI should have first informed you that you will need Node v22.10 or later, even before it tried to run the script. (See recent announcement)

I now see that the notification is set as a warning and not an error, so the warning is probably being suppressed unless you ask for verbose debugging information.

After you update node, the CLI should apply the correct `npm install` automatically inside core/script/dynsub/.

Brian



--
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/b3dd2152-fa67-4a57-b4ae-92e6bb8984can%40googlegroups.com.

Sean Fitzpatrick

unread,
Jul 17, 2025, 1:18:07 PM7/17/25
to PreTeXt support
This was the problem -- I'm running Ubuntu 22.04 on my server, which ships with Node v22.2.0.
I'll upgrade to the LTS (22.17.0), unless there's a reason to go to latest.

D. Brian Walton

unread,
Jul 17, 2025, 4:03:24 PM7/17/25
to pretext...@googlegroups.com
There should be no need to go to the latest.

Brian

Reply all
Reply to author
Forward
0 new messages