[BUG] /doctor ERROR Cannot assign to read only property '0' of object '[object String]'
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
- In terminal: claude
- 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:
- Primary: Claude Code v1.0.72 has a bug with string property assignment in strict mode
- Secondary: Node version switching not taking effect properly
- Environment: Running from within Claude Code creates stdin conflicts
Recommended Actions (run in your terminal):
- Close all Claude Code sessions and open a fresh terminal
- Force Node v20 usage:
source ~/.zshrc # Load the new PATH
node --version # Should show v20.19.4
- If still on v22, manually export:
export PATH="$HOME/.nvm/versions/node/v20.19.4/bin:$PATH"
- Reinstall Claude Code with Node v20:
npm uninstall -g @anthropic-ai/claude-code
npm install -g @anthropic-ai/claude-code
- Test in a new terminal session:
claude --version
claude
If issues persist:
- Report the bug at: https://github.com/anthropics/claude-code/issues
- Include: Node version, macOS version, terminal type, and the exact error
- This appears to be a known compatibility issue with recent Claude Code versions
The root cause is likely a bug in Claude Code v1.0.72 that wasn't present in earlier versions.
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗