3.3 KiB
3.3 KiB
Troubleshooting Guide
This guide provides solutions to common issues and debugging tips.
Frequently asked questions (FAQs)
-
Q: How do I update Gemini CLI to the latest version?
- A: If installed globally via npm, update Gemini CLI using the command
npm install -g @gemini-cli/cli@latest
. If run from source, pull the latest changes from the repository and rebuild usingnpm run build
.
- A: If installed globally via npm, update Gemini CLI using the command
-
Q: Where are Gemini CLI configuration files stored?
- A: The CLI configuration is stored within two
settings.json
files: one in your home directory and one in your project's root directory. In both locations,settings.json
is found in the.gemini/
folder. Refer to CLI Configuration for more details.
- A: The CLI configuration is stored within two
Common error messages and solutions
-
Error:
EADDRINUSE
(Address already in use) when starting an MCP server.- Cause: Another process is already using the port the MCP server is trying to bind to.
- Solution: Either stop the other process that is using the port or configure the MCP server to use a different port.
-
Error: Command not found (when attempting the run Gemini CLI).
- Cause: Gemini CLI is not correctly installed or not in your system's PATH.
- Solution:
- Ensure Gemini CLI installation was successful.
- If installed globally, check that your npm global binary directory is in your PATH.
- If running from source, ensure you are using the correct command to invoke it (e.g.,
node packages/cli/dist/index.js ...
).
-
Error:
MODULE_NOT_FOUND
or import errors.- Cause: Dependencies are not installed correctly, or the project hasn't been built.
- Solution:
- Run
npm install
to ensure all dependencies are present. - Run
npm run build
to compile the project.
- Run
-
Error: "Operation not permitted", "Permission denied", or similar.
- Cause: If sandboxing is enabled, then the application is likely attempting an operation restricted by your sandbox, such as writing outside the project directory or system temp directory.
- Solution: See Sandboxing for more information, including how to customize your sandbox configuration.
Debugging Tips
-
CLI debugging:
- Use the
--verbose
flag (if available) with CLI commands for more detailed output. - Check the CLI logs, often found in a user-specific configuration or cache directory.
- Use the
-
Core debugging:
- Check the server console output for error messages or stack traces.
- Increase log verbosity if configurable.
- Use Node.js debugging tools (e.g.,
node --inspect
) if you need to step through server-side code.
-
Tool issues:
- If a specific tool is failing, try to isolate the issue by running the simplest possible version of the command or operation the tool performs.
- For
run_shell_command
, check that the command works directly in your shell first. - For file system tools, double-check paths and permissions.
-
Pre-flight checks:
- Always run
npm run preflight
before committing code. This can catch many common issues related to formatting, linting, and type errors.
- Always run
If you encounter an issue not covered here, consider searching the project's issue tracker on GitHub or reporting a new issue with detailed information.