fix: Always use npx — stop silent global install failures
Remove the npm install -g attempt from the installer that silently fails on many systems (permissions, PATH, node version managers). All configs (MCP server, hooks, next-steps) now always use npx @colbymchenry/codegraph. Global install offered as an optional tip. Fixes #37, #38
This commit is contained in:
@@ -1015,17 +1015,17 @@ program
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
// Spawn `codegraph sync` as a detached background process
|
||||
// so this hook exits immediately and doesn't block Claude Code
|
||||
const isWindows = process.platform === 'win32';
|
||||
// Spawn sync as a detached background process
|
||||
// so this hook exits immediately and doesn't block Claude Code.
|
||||
// Uses process.argv[0]/[1] (e.g. node /path/to/codegraph.js) so it
|
||||
// works whether invoked via global install, npx, or directly.
|
||||
const child = spawn(
|
||||
isWindows ? 'codegraph' : process.argv[0]!,
|
||||
isWindows ? ['sync', '--quiet', projectRoot!] : [process.argv[1]!, 'sync', '--quiet', projectRoot!],
|
||||
process.argv[0]!,
|
||||
[process.argv[1]!, 'sync', '--quiet', projectRoot!],
|
||||
{
|
||||
detached: true,
|
||||
stdio: 'ignore',
|
||||
windowsHide: true,
|
||||
shell: isWindows,
|
||||
}
|
||||
);
|
||||
child.unref();
|
||||
|
||||
Reference in New Issue
Block a user