curiousdannii/parchment

Can't build parchment on Ubuntu using README instructions

Closed this issue · 2 comments

The README leaves a bit up in the air, and refers to python scripts that no longer seem to be in the distribution, so I'm not sure where in the chain my problems lie. My ultimate goal is to have a version of parchment I can adjust the CSS for to fit into an existing Web site (so the one-page version doesn't help me, as the glkote CSS is buried way too deep inside the base64 blobs).

On Ubuntu 22.04 LTS, when I try to follow the instructions (pulling dependencies, and then running npm install --no-package-lock), I get the following error:

        copy: await readdir('src/fonts/iosevka'),
              ^^^^^

SyntaxError: Unexpected reserved word
    at Loader.moduleStrategy (internal/modules/esm/translators.js:133:18)
    at async link (internal/modules/esm/module_job.js:42:21)

This code isn't inside a function at all, let alone an async one, so I shrugged my shoulders and serialised everything by cutting out the await keywords:

internal/process/esm_loader.js:74
    internalBinding('errors').triggerUncaughtException(
                              ^

Error [ERR_MODULE_NOT_FOUND]: Cannot find package 'fs' imported from [REDACTED]/parchment/build.js
    at packageResolve (internal/modules/esm/resolve.js:664:9)
    at moduleResolve (internal/modules/esm/resolve.js:705:18)
    at Loader.defaultResolve [as _resolve] (internal/modules/esm/resolve.js:798:11)
    at Loader.resolve (internal/modules/esm/loader.js:100:40)
    at Loader.getModuleJob (internal/modules/esm/loader.js:246:28)
    at ModuleWrap.<anonymous> (internal/modules/esm/module_job.js:47:40)
    at link (internal/modules/esm/module_job.js:46:36) {
  code: 'ERR_MODULE_NOT_FOUND'
}

You're probably using Node 12 which is past end of life. Try updating to a version of Node >= 14.8.

I updated the Readme.