docs(windows): add npm global path fix (#1272)

This commit is contained in:
stamsam
2026-05-23 12:57:43 +08:00
committed by GitHub
parent 9b3c90418b
commit 8cd998de68
2 changed files with 34 additions and 0 deletions
+17
View File
@@ -78,6 +78,7 @@ At that point, you can ask it to:
Cause:
- npm installed the package, but your terminal has not refreshed yet
- on Windows, npm's global bin folder may not be in your user `Path`
Fix:
@@ -85,6 +86,22 @@ Fix:
2. Open a new terminal
3. Run `openclaude` again
On Windows PowerShell, if that still does not work, add npm's global bin folder
to your user `Path`, then open a new PowerShell window:
```powershell
$npmPrefix = npm config get prefix
$currentUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (($currentUserPath -split ';') -notcontains $npmPrefix) {
[Environment]::SetEnvironmentVariable(
"Path",
"$currentUserPath;$npmPrefix",
"User"
)
}
```
### Invalid API key
Cause:
+17
View File
@@ -103,6 +103,23 @@ Close PowerShell, open a new one, and try again:
openclaude
```
If PowerShell still says `openclaude` is not recognized, npm's global bin
folder may be missing from your user `Path`. Add it, then open a new
PowerShell window:
```powershell
$npmPrefix = npm config get prefix
$currentUserPath = [Environment]::GetEnvironmentVariable("Path", "User")
if (($currentUserPath -split ';') -notcontains $npmPrefix) {
[Environment]::SetEnvironmentVariable(
"Path",
"$currentUserPath;$npmPrefix",
"User"
)
}
```
## 5. If Your Provider Fails
Check the basics: