codegraph icon indicating copy to clipboard operation
codegraph copied to clipboard

Linux - Seems to install, but "command not found" on any subsequent invocations

Open lh1022 opened this issue 9 months ago • 6 comments

Ubuntu 25.04 - the installer seems to complete fine

Image

... but any subsequent invocations of codegraph result in command not found

Doesn't appear to be present on the drive:

└─ $ sudo find / -name codegraph -type f 2>/dev/null

lh1022 avatar Feb 13 '26 16:02 lh1022

Same issue on MacOS

So if you install the npm package globally, that appears to work. But trying to index you're hit with

Parsing code: ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░ 0% lib///***/.dart ✗ Failed to index: Cannot read properties of undefined (reading 'length')

swisscheesy avatar Feb 14 '26 06:02 swisscheesy

@swisscheesy @lh1022 try installing the latest version 0.5.5 and let me know if the issue persists. Thanks!

colbymchenry avatar Feb 14 '26 06:02 colbymchenry

i just had the same problem with using codegraph v0.5.7 (using the automated setup with npx @colbymchenry/codegraph. I then just ran the command npm install -g @colbymchenry/codegraph manually and now it's working.

thomasrepnik avatar Feb 14 '26 12:02 thomasrepnik

@thomasrepnik thank you for the feedback. The issue is there are some packages that use native binaries. Some of them do not offer the native binaries for certain environments and system configurations. I worked on using a non binary workaround which should have worked. But that's what's causing the installer to fail silently and I've been trying to resolve it.

colbymchenry avatar Feb 14 '26 21:02 colbymchenry

This should be fixed in v0.6.2. The root cause was that command -v codegraph always passes inside an npx context (npx puts a temporary binary in PATH), so the installer was skipping npm install -g entirely — thinking codegraph was already installed.

The fix removes that check and always runs npm install -g. Can you retest with:

npx @colbymchenry/codegraph@latest

Then verify codegraph init -i works afterward. Let me know if you're still seeing the issue!

colbymchenry avatar Feb 19 '26 21:02 colbymchenry

@thomasrepnik try the latest v0.6.2 install with npx as normal

npx @colbymchenry/codegraph@latest

I tested myself after it failing on my second laptop until it worked. Exact same issue you are reporting here, it should definitely work for you this time.

colbymchenry avatar Feb 19 '26 22:02 colbymchenry