env: node: No such file or directory - CC Switch
Quick fix
Upgrading cc-switch to v3.18.0 or newer fixes the environment variable resolution failure caused by a stripped PATH in the GUI.
Symptom
Section titled “Symptom”env: node: No such file or directoryRunning an upgrade or launch command directly from the GUI, the system passes a stripped-down PATH environment variable, so the shebang in a script (#!/usr/bin/env node) or the application executable cannot be resolved. The defect mainly affects applications that depend on the npm path or a global CLI (OpenClaw, Claude Code).
From v3.18.0, the updater prepends the npm sibling bin directory to PATH automatically before running the anchored npm upgrade command, covering common Node installations through nvm, fnm, mise, and Homebrew. Some Windows users report a restart relieving it temporarily, but the real answer is still the updated environment injection logic.
Uninstall your current version of cc-switch, then download and install v3.18.0 or newer from the official repository.
Affected Versions
Section titled “Affected Versions”Source Issues
Section titled “Source Issues”This page is distilled from 4 real issues
- #5252通过 GUI 升级 OpenClaw 时报错 env: node: No such file or directory(npm 类升级未注入 node 环境)
- #4595Claude Code 直接选择模型打开终端,提示找不到claude,虽然使用了底层似乎调用了cmd,而不是windows terminal,我调整了首选终端,也没有效果
- #7347[Bug] WSL: 本地环境检查的「当前版本」显示为 Ubuntu 版本号(MOTD 混入版本探测输出) / WSL tool version shows the Ubuntu release number
- #6741[BUG] v3.20.0 Windows 升级 OpenCode/Codex 报「系统找不到指定的路径」(npm prefix 位于 fnm 目录)
(No FAQ yet)
Related problems
Section titled “Related problems”This is an unofficial community wiki with no affiliation to the cc-switch authors or the project itself. Its content is compiled from the project's public GitHub issues. This site distributes no software.