Skip to content

Commit 4996a08

Browse files
authored
docs: add troubleshooting for npx cache (#2409)
* docs: update docs
1 parent f3cf085 commit 4996a08

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

docs/@v2/commands/preview.md

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,3 +66,30 @@ redocly preview --port=8888
6666
```
6767

6868
This command starts the preview on port 8888, so you can access the docs at `http://localhost:8888` or `http://127.0.0.1:8888`.
69+
70+
## Troubleshoot
71+
72+
### Internal Server Error
73+
74+
An **Internal Server Error** page when running the preview command is often caused by a corrupted or outdated npx cache.
75+
The preview command uses npx internally to launch product packages, and cached packages can sometimes cause issues.
76+
77+
#### Clear the npx cache
78+
79+
Clear the npx cache:
80+
81+
```bash
82+
npm cache clean --force
83+
```
84+
85+
After clearing the cache, try running the preview command again.
86+
87+
#### Install Redocly CLI globally
88+
89+
Install Redocly CLI globally to avoid cache-related issues:
90+
91+
```bash
92+
npm install -g @redocly/cli@latest
93+
```
94+
95+
After installation, the `redocly` command is available globally, which helps avoid npx cache issues.

0 commit comments

Comments
 (0)