vitest-dev / vscode

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

Extension Fails to Install #510

Open jwalkerinterpres opened 1 month ago

jwalkerinterpres commented 1 month ago

Describe the bug

After I installed the extension, a little pop-up appeared in the lower-right:

There was an error during Vitest startup. Check the output for more details.

When I clicked the "See Error" button below it, I went to the "Output" tab, where I saw see "Output" below.

The testing tab showed no sign of the extension being installed: image

However, Vite Test itself runs just fine for this project, when run at the command line:

image

This seems similar to https://github.com/vitest-dev/vscode/issues/383, but that issue has a very different stack trace vs. this one. It also seems similar to https://github.com/vitest-dev/vscode/issues/381 (and I am using NVM) ... but that issue is closed.

Reproduction

I only know two steps:

  1. Install the extension (I had installed it previously, but removed it; not sure if that's relevant)
  2. Get the error

I'd be happy to provide further reproduction info if you can instruct me on what log file (or whatever) would be useful to provide.

Output

[INFO 4:39:54 PM] [v1.6.1] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 4:39:54 PM] [API] Using user root config: /Users/me/project/project/vite.config.ts
[INFO 4:39:54 PM] [API] Running Vitest v2.1.2 (project/vite.config.ts) with Node.js@v18.20.4: /Users/me/.nvm/versions/node/v18.20.4/bin/node 
[Error 4:39:54 PM] [API] [Error Error] spawn /Users/me/.nvm/versions/node/v18.20.4/bin/node ENOENT
Error: spawn /Users/me/.nvm/versions/node/v18.20.4/bin/node ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)
[Error 4:39:54 PM] [Error Error] spawn /Users/me/.nvm/versions/node/v18.20.4/bin/node ENOENT
Error: spawn /Users/me/.nvm/versions/node/v18.20.4/bin/node ENOENT
    at ChildProcess._handle.onexit (node:internal/child_process:286:19)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:82:21)

Version

1.6.1

Validations

sheremet-va commented 1 month ago

I don't really know why it fails, it cannot spawn a node process for some reason. You can try using the vitest.shellType: terminal option instead.