Skip to content

Never stop coding. Free MIT AI gateway: one endpoint, 375 providers (150+ free), 1,400+ models Kimi, Claude, GPT, Gemini, GLM, DeepSeek, MiniMax. Works with Claude Code, Codex, Cursor, OpenCode, Cline & Copilot. Quota-aware auto-fallback, RTK+Caveman compression saves 15-95% tokens, MCP/A2A, Desktop/PWA. Built by 900+ contributors

fix(3.0.0-rc/batch2): resolve issues #510, #492, and improve #520, #529

diegosouzapw0acef57865df
diff --git a/bin/omniroute.mjs b/bin/omniroute.mjs
index c2c11c0194..28d511da92 100755
--- a/bin/omniroute.mjs
+++ b/bin/omniroute.mjs
@@ -189,8 +189,27 @@ const serverJs = join(APP_DIR, "server.js");
if (!existsSync(serverJs)) {
console.error("\x1b[31m✖ Server not found at:\x1b[0m", serverJs);
- console.error(" This usually means the package was not built correctly.");
- console.error(" Try reinstalling: npm install -g omniroute");
+ console.error(" The package may not have been built correctly.");
+ console.error("");
+ // (#492) Detect common non-standard Node managers that cause this issue
+ const nodeExec = process.execPath || "";
+ const isMise = nodeExec.includes("mise") || nodeExec.includes(".local/share/mise");
+ const isNvm = nodeExec.includes(".nvm") || nodeExec.includes("nvm");
+ if (isMise) {
+ console.error(
+ " \x1b[33m⚠ mise detected:\x1b[0m If you installed via `npm install -g omniroute`,"
+ );
+ console.error(" try: \x1b[36mnpx omniroute@latest\x1b[0m (downloads a fresh copy)");
+ console.error(" or: \x1b[36mmise exec -- npx omniroute\x1b[0m");
+ } else if (isNvm) {
+ console.error(
+ " \x1b[33m⚠ nvm detected:\x1b[0m Try reinstalling after loading the correct Node version:"
+ );
+ console.error(" \x1b[36mnvm use --lts && npm install -g omniroute\x1b[0m");
+ } else {
+ console.error(" Try: \x1b[36mnpm install -g omniroute\x1b[0m (reinstall)");
+ console.error(" Or: \x1b[36mnpx omniroute@latest\x1b[0m");
+ }
process.exit(1);
}
diff --git a/src/shared/services/cliRuntime.ts b/src/shared/services/cliRuntime.ts
index 5bd9bc1893..bbfd706c2e 100644
--- a/src/shared/services/cliRuntime.ts
+++ b/src/shared/services/cliRuntime.ts
@@ -105,6 +105,24 @@ const CLI_TOOLS: Record<string, any> = {
const isWindows = () => process.platform === "win32";
+/**
+ * (#510) Normalize MSYS2/Git-Bash style paths to Windows-native paths.
+ * On Windows with Git Bash, 'where claude' may return '/c/Program Files/...'
+ * instead of 'C:\\Program Files\\...'. Convert these so the path is usable
+ * by Node's fs and child_process modules.
+ */
+const normalizeMsys2Path = (p: string): string => {
+ if (!p || !isWindows()) return p;
+ // Match /letter/rest-of-path — MSYS2 POSIX-style drive mount
+ const msys2Match = p.match(/^\/([a-zA-Z])\/(.+)$/);
+ if (msys2Match) {
+ const drive = msys2Match[1].toUpperCase();
+ const rest = msys2Match[2].replace(/\//g, "\\");
+ return `${drive}:\\${rest}`;
+ }
+ return p;
+};
+
const parseBoolean = (value: unknown, defaultValue = true) => {
if (value == null || value === "") return defaultValue;
return !FALSE_VALUES.has(String(value).trim().toLowerCase());
@@ -256,7 +274,7 @@ const locateCommand = async (command: string, env: Record<string, string | undef
const first =
located.stdout
.split(/\r?\n/)
- .map((line) => line.trim())
+ .map((line) => normalizeMsys2Path(line.trim()))
.find(Boolean) || null;
return { installed: !!first, commandPath: first, reason: first ? null : "not_found" };
}
@@ -271,7 +289,7 @@ const locateCommand = async (command: string, env: Record<string, string | undef
const first =
located.stdout
.split(/\r?\n/)
- .map((line) => line.trim())
+ .map((line) => normalizeMsys2Path(line.trim()))
.find(Boolean) || null;
return { installed: !!first, commandPath: first, reason: first ? null : "not_found" };
};