Raw mode terminal issue - Claude Doctor
✗ Auto-update failed · Try claude doctor or npm i -g @anthropic-ai/claude-code. The raw mode error is related to the terminal environment not supporting raw mode, which is required for interactive CLI applications. It's a limitation of the current terminal environment.
Create a user-writable npm prefix in your home directory: - mkdir -p ~/.npm-global - npm config set prefix ~/.npm-global - echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc
● Let's try setting up the user-writable npm prefix:
● Bash(mkdir -p ~/.npm-global)… ⎿ (No content)
● Bash(npm config set prefix ~/.npm-global)… ⎿ (No content)
● Bash(echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.bashrc)… ⎿ (No content)
● Bash(source ~/.bashrc)… ⎿ (No content)
● The changes have been applied successfully:
- Created the ~/.npm-global directory
- Set npm to use this directory for global packages
- Added the directory to your PATH in ~/.bashrc
- Applied the changes to your current session
Now you should be able to install global npm packages without permission issues. Try running claude doctor to verify the fix or reinstall Claude Code with npm i -g @anthropic-ai/claude-code.
claude doctor
● Let's run the Claude Doctor command to check the status of your Claude Code installation:
● Bash(claude doctor)… ⎿ Error: Command timed out after 2m 0.0s Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default. Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported at handleSetRawMode (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:637:3662) at file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:646:259 at cG (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:21373) at fY (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:40857) at file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:39053 at tN1 (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:87:20286) at Immediate.lN1 [as _onImmediate] (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:87:20704) at process.processImmediate (node:internal/timers:483:21) … +50 lines (ctrl+r to see all)
● I see the issue now. We're encountering a different error related to the terminal's raw mode support. This often happens in certain environments where the terminal doesn't support raw mode, which is needed for interactive CLI tools.
Let's try reinstalling Claude Code with the latest version:
● Bash(npm i -g @anthropic-ai/claude-code)… ⎿ Error: npm error code ENOTEMPTY npm error syscall rename npm error path /root/.npm-global/lib/node_modules/@anthropic-ai/claude-code npm error dest /root/.npm-global/lib/node_modules/@anthropic-ai/.claude-code-4BoKlw1H npm error errno -39 npm error ENOTEMPTY: directory not empty, rename '/root/.npm-global/lib/node_modules/@anthropic-ai/claude-code' -> '/root/.npm-global/lib/node_modules/@anthropic-ai/.claude-code-4BoKlw1H' npm error A complete log of this run can be found in: /root/.npm/_logs/2025-06-05T15_26_32_391Z-debug-0.log
● It looks like we're still encountering permission issues with npm. The error shows npm is trying to install to /root/.npm-global rather than your user directory. This indicates we need to take a different approach.
Let's try adding the --user flag to bypass the permission issues:
● Bash(npm i -g @anthropic-ai/claude-code --user)… ⎿ Error: npm error code ENOTEMPTY npm error syscall rename npm error path /root/.npm-global/lib/node_modules/@anthropic-ai/claude-code npm error dest /root/.npm-global/lib/node_modules/@anthropic-ai/.claude-code-4BoKlw1H npm error errno -39 npm error ENOTEMPTY: directory not empty, rename '/root/.npm-global/lib/node_modules/@anthropic-ai/claude-code' -> '/root/.npm-global/lib/node_modules/@anthropic-ai/.claude-code-4BoKlw1H' npm error A complete log of this run can be found in: /root/.npm/_logs/2025-06-05T15_26_37_891Z-debug-0.log
● I see the issue more clearly now. The global npm prefix is set to /root/.npm-global (root user directory) rather than your user's home directory. Let's check your current npm configuration:
● Bash(npm config get prefix)… ⎿ /root/.npm-global
● Bash(echo $HOME)… ⎿ /root
● Now I understand the problem! You're actually running as the root user, so the npm global directory is correctly set to /root/.npm-global. However, there seems to be an issue with the directory permissions.
Let's try to fix the permissions on the npm global directory:
● Bash(mkdir -p /root/.npm-global && chown -R root:root /root/.npm-global && chmod -R 755 /root/.npm-global)… ⎿ (No content)
● Now let's try to remove the existing installation and reinstall:
● Bash(rm -rf /root/.npm-global/lib/node_modules/@anthropic-ai/claude-code)… ⎿ (No content)
● Bash(npm i -g @anthropic-ai/claude-code)… ⎿ added 3 packages in 2s
2 packages are looking for funding
run `npm fund` for details
● Great! The installation was successful. Let's try running Claude Doctor again:
● Bash(claude doctor)… ⎿ Error: Command timed out after 2m 0.0s Error: Raw mode is not supported on the current process.stdin, which Ink uses as input stream by default. Read about how to prevent this error on https://github.com/vadimdemedes/ink/#israwmodesupported at handleSetRawMode (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:637:3662) at file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:646:259 at cG (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:21373) at fY (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:40857) at file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:93:39053 at tN1 (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:87:20286) at Immediate.lN1 [as _onImmediate] (file:///root/claude-bin/node_modules/@anthropic-ai/claude-code/cli.js:87:20704) at process.processImmediate (node:internal/timers:483:21) … +50 lines (ctrl+r to see all)
● We're still seeing the raw mode error, which is a different issue from the permissions problem we initially addressed.
This error is related to the terminal environment not supporting raw mode, which is required for interactive CLI applications. It's a limitation of the current terminal environment rather than a permissions issue.
For this specific error, you'll need to:
- File an issue at https://github.com/anthropics/claude-code/issues with details about: - The environment you're running Claude Code in - The error message you're seeing - The fact that you've successfully installed the package but are getting raw mode errors
- As a workaround, you could try the non-interactive version of Claude Code (if available) or use Claude Code in an environment with a full TTY terminal that supports raw mode.
The permission issue appears to be resolved as the package installed successfully, but this raw mode error is a separate terminal capability issue.