I’m trying to run Vitest with the UI enabled using:
"scripts": {
"test:ui": "vitest --ui"
}
When I run it with:
npm run test:ui
I get the following error:
Error: listen EACCES: permission denied ::1:51204
The issue was that Vitest UI was trying to bind to port 51204 (IPv6 ::1:51204), which Windows was denying permission.
The solution was to explicitly specify a port with the --api option.
Instead of:
"test:ui": "vitest --ui"
use:
"test:ui": "vitest --ui --api 3001"
Now the UI runs properly on port 3001 and displays all test results without errors.