Skip to content

cli installs but crashes on startup with import error #23

@tkalejaiye

Description

@tkalejaiye

I'm able to install the cli globally, but attempting to run any commands results in the following error:

file:///.../.nvm/versions/node/v20.18.1/lib/node_modules/@aredotna/cli/node_modules/@jimp/plugin-print/dist/esm/load-bitmap-font.js:7
import xmlPackage from "simple-xml-to-json";
       ^^^^^^^^^^
SyntaxError: The requested module 'simple-xml-to-json' does not provide an export named 'default'
    at ModuleJob._instantiate (node:internal/modules/esm/module_job:146:21)
    at async ModuleJob.run (node:internal/modules/esm/module_job:229:5)
    at async ModuleLoader.import (node:internal/modules/esm/loader:473:24)
    at async asyncRunEntryPointWithESMLoader (node:internal/modules/run_main:122:5)

Root cause according to Claude:

The CLI depends on @jimp/plugin-print (through terminal-image → jimp), which imports simple-xml-to-json like this:

import xmlPackage from "simple-xml-to-json";

This expects a default export. Version 1.2.3 of simple-xml-to-json has one. Version 1.2.5 removed it — it only has named exports now.

When you build from the cloned repo, the lockfile pins 1.2.3, so it works. When you npm install -g, there's no lockfile — npm grabs the latest (1.2.5), and it breaks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions