Skip to content

If ~/.local/lib does not pre-exist, npx githits@latest init will fail #257

Description

@jarkkojs

The example environment has everything installed with bun.

❯ npx githits@latest init
npm ERR! code ENOENT
npm ERR! syscall lstat
npm ERR! path /home/jarkko/.local/lib
npm ERR! errno -2
npm ERR! enoent ENOENT: no such file or directory, lstat '/home/jarkko/.local/lib'
npm ERR! enoent This is related to npm not being able to find a file.
npm ERR! enoent 

npm ERR! A complete log of this run can be found in:
npm ERR!     /home/jarkko/.npm/_logs/2026-08-05T15_03_37_743Z-debug-0.log

Workaround to make the command work is of course mkdir -p ~/.local/lib. However, ending up to this situation was due human error: I was supposed to do bunx githits@latest init but wrote npx by mistake.

What I would recommend as a fix, given that often doing this gives a strong clue of a human error, is to confirm before proceeding further.

To make it smarter and better user experience overall, I would also query for pre-existing bun environment and hint about bun as part of the confirmation, if the environment exists. I.e. couple of versions of confirmation based on environment would be the optimal solution.

Offering to spawn bunx or anything like that would be IMHO overdoing, and does not help with anything.

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