Can't find $SHELL even though it exists

Status Fixed / completed
Maintainer reply ✓ Yes — wolffiex
Activity 7 comments · opened Mar 5, 2025 · closed Mar 5, 2025
💡 Likely answer: A maintainer (wolffiex, collaborator) responded on this thread — see the highlighted reply below.

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 ↗

7 Comments

taygetea · 1 year ago

same here.

silleknarf · 1 year ago

+1

Update: I rolled back to the previous version as a workaround:

npm install -g @anthropic-ai/claude-code@0.2.29
claude config set -g autoUpdaterStatus disabled

I get this error too. It was working for me yesterday.

I'm using zsh on Android termux. I tried updating to the latest version of claude. I also tried setting the SHELL env variable to bash.

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:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8036)
    at new i6 (file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:5985)
    at i6.getInstance (file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:339:8426)
    at process.<anonymous> (file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:1167:5527)                                                     at process.emit (node:events:536:35)                       at process.emit (node:domain:489:12)                       at process.I [as emit] (file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:139:26041)                                                     at process.exit (node:internal/process/per_thread:182:15)                                                             at onExit (file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:1137:1021)
    at file:///data/data/com.termux/files/usr/lib/node_modules/@anthropic-ai/claude-code/cli.mjs:430:2280
wolffiex collaborator · 1 year ago

Hi can you please try 0.2.32 and let us know if it resolves your issue? Thanks!

kjekac · 1 year ago

Yes, all good on my end. Thank you!

lucassong3000 · 1 year ago
Yes, all good on my end. Thank you!

i have exactly the same issue, i notice you are not building the app through nixpkgs? the latest version is only 0.2.30 on nixpkgs, which the issue persists

jqcorreia · 1 year ago

I can confirm that this is fixed 0.2.48. Thanks

github-actions[bot] · 1 year ago

This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.