vitest-dev / vscode

VS Code extension for Vitest
https://vitest.dev/vscode
MIT License
729 stars 79 forks source link

Unable to start extension #392

Closed joyceli214 closed 1 month ago

joyceli214 commented 1 month ago

Describe the bug

Hi all, I am new to vite and just trying to get my tests running. However, when I tried to start the extension, it always resulted in the same error below

I am using below versions vscode 1.89.0 vscode extension 0.10.7

I have tried

Reproduction

https://github.com/vitest-dev/vitest/tree/main/examples/basic I have tried with the example code from vitest and also could not start the extension (running npm test can run tests tho

Output

[INFO 11:16:07 AM] [v0.10.7] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 11:16:10 AM] [API] Running Vitest: v1.6.0 (vite.config.ts)
[INFO 11:16:10 AM] [API] Starting Vitest process with Node.js: C:\Program Files (x86)\nodejs\node.EXE
[Error 11:16:18 AM] [Error Error] Vitest failed to start: 

r
Error: Vitest failed to start: 

r
    at ChildProcess.f (c:\Users\[my username]\.vscode\extensions\vitest.explorer-0.10.7\dist\extension.js:19:333)
    at ChildProcess.emit (node:events:517:28)
    at emit (node:internal/child_process:944:14)
    at processTicksAndRejections (node:internal/process/task_queues:83:21)

Version

0.10.7

Validations

nadihsu commented 1 month ago

I encountered the same problem in vitest@0.10.7

joyceli214 commented 1 month ago

I seemed to have gotten the extension running after upgrading node version from 16.15.1 to 20.13.1. Maybe could consider adding compatible node versions to the docs?

sheremet-va commented 1 month ago

Vitest requires Node 18+ which is mentioned in its documentation.

I guess we can check the version in the extension before spawning Vitest