[BUG] /doctor ERROR Cannot assign to read only property '0' of object '[object String]'

Resolved 💬 2 comments Opened Aug 11, 2025 by pcrausaz Closed Aug 11, 2025

Environment

  • Claude CLI version: 1.0.72 (Claude Code)
  • Operating System: macOS 15
  • Terminal: Terminal App

Bug Description

  • Starting Claude shows an error with the settings file. Running /doctor displays:

/doctor gives me ERROR Cannot assign to read only property '0' of object '[object String]'

file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropic-a
i/claude-code/cli.js:674:6895

-QpB (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:674:6895)
-FpB (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:674:7096)
-FoB (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:674:32482)
-NoB (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:674:33679)

  • (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropi

c-ai/claude-code/cli.js:2315:517)

  • at Array.forEach (<anonymous>)

-RH8 (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:2315:38)

  • (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthropi

c-ai/claude-code/cli.js:2315:1018)

  • at Array.map (<anonymous>)

-fvB (file:///Users/pascal/.nvm/versions/node/v20.19.4/lib/node_modules/@anthr
opic-ai/claude-code/cli.js:2315:869)

Steps to Reproduce

  1. In terminal: claude
  2. In Claude console: /doctor

Expected Behavior

'Normal' /doctor output

Actual Behavior

see above

Additional Context

This all started with a benign error with the hooks defined in my global :

cat settings.json
{
"hooks": {
"stop": [{
"matcher": {},
"hooks": [{
"type": "command",
"command": "afplay /System/Library/Sounds/Glass.aiff && osascript -e 'tell application \"Messages\" to send \"COMPLETED: Claude Code session ended\" to buddy \"<redacted>\"'"
}]
}],
"notification": [{
"matcher": {},
"hooks": [{
"type": "command", "command": "afplay /System/Library/Sounds/Glass.aiff && osascript -e 'tell application \"Messages\" to send \"INTERRUPTED: Claude Code session requires info\" to buddy \"<redacted>\"'"
}]
}]
}
}

I asked Claude to fix it, which Claude Code struggled with, identifying a possible issue with the latest version of node which was 22, Claude code downgraded to v20.19.4 and through the process we ended up here.

Claude Code final analysis was:
Summary & Next Steps

Your Claude Code installation appears to have multiple issues that require manual intervention in your
terminal:

Issue Analysis:

  1. Primary: Claude Code v1.0.72 has a bug with string property assignment in strict mode
  2. Secondary: Node version switching not taking effect properly
  3. Environment: Running from within Claude Code creates stdin conflicts

Recommended Actions (run in your terminal):

  1. Close all Claude Code sessions and open a fresh terminal
  2. Force Node v20 usage:

source ~/.zshrc # Load the new PATH
node --version # Should show v20.19.4

  1. If still on v22, manually export:

export PATH="$HOME/.nvm/versions/node/v20.19.4/bin:$PATH"

  1. Reinstall Claude Code with Node v20:

npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code

  1. Test in a new terminal session:

claude --version
claude

If issues persist:

The root cause is likely a bug in Claude Code v1.0.72 that wasn't present in earlier versions.

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗