Can't find $SHELL even though it exists

Resolved 💬 7 comments Opened Mar 5, 2025 by kjekac Closed Mar 5, 2025

What the title says, basically. Worked fine until yesterday. Happy to run additional commands to help troubleshoot.

λ ~/ nixos-version                           
24.11.712512.3f0a8ac25fb6 (Vicuna)

λ ~/ which claude                    
/home/kjekac/.npm-global/bin/claude
λ ~/dev/temp/pallas/ master* nix develop
warning: Git tree '/home/kjekac/dev/temp/pallas' is dirty

[kjekac@Thastrom:~/dev/temp/pallas]$ echo $SHELL
/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash

[kjekac@Thastrom:~/dev/temp/pallas]$ which bash
/nix/store/306znyj77fv49kwnkpxmb0j2znqpa8bj-bash-5.2p26/bin/bash

[kjekac@Thastrom:~/dev/temp/pallas]$ claude
╭────────────────────────────────────────────╮
│ ✻ Welcome to Claude Code research preview! │
│                                            │
│   /help for help                           │
│                                            │
│   cwd: /home/kjekac/dev/temp/pallas        │
╰────────────────────────────────────────────╯

╭────────────────────────────────────────────────────────────────────────────────╮
│ >                                                                              │
╰────────────────────────────────────────────────────────────────────────────────╯
  ! for bash mode · / for commands · esc to undo                  \⏎ for newline


This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:
Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.
    at i6.findSuitableShell (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8036)
    at new i6 (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:5985)
    at i6.getInstance (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8426)
    at mw (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:344:1172)
    at aH (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:1162:14518)
    at cz1.<anonymous> (file:///home/kjekac/.npm-global/lib/node_modules/@anthropi
╭────────────────────────────────────────────────────────────────────────────────╮
│ > Try "refactor kern.sire"                                                     │
╰────────────────────────────────────────────────────────────────────────────────╯
  ! for bash mode · / for commands · esc to undo                  \⏎ for newline

Error: No suitable shell found. Claude CLI requires a Posix shell environment. Please ensure you have a valid shell installed and the SHELL environment variable set.
    at i6.findSuitableShell (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8036)
    at new i6 (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:5985)
    at i6.getInstance (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8426)
    at process.<anonymous> (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:1167:5527)
    at process.emit (node:events:530:35)
    at process.emit (node:domain:489:12)
    at process.I [as emit] (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:139:26041)
    at process.exit (node:internal/process/per_thread:183:15)
    at onExit (file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:1137:1021)
    at file:///home/kjekac/.npm-global/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:430:2280

View original on GitHub ↗

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