Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to get Node.js version #413

Closed
4 tasks done
bennycode opened this issue Jun 10, 2024 · 6 comments
Closed
4 tasks done

Failed to get Node.js version #413

bennycode opened this issue Jun 10, 2024 · 6 comments
Labels
p4-important Violate documented behavior or significantly improves performance (priority)

Comments

@bennycode
Copy link

bennycode commented Jun 10, 2024

Describe the bug

On VS Code startup I am receiving an error from the "vitest.explorer" extension.

Screenshot:

image

When I run /home/bennycode/.nvm/versions/node/v20.10.0/bin/node --version on my Terminal it shows v20.10.0.

Reproduction

  • Install Node.js v20 with nvm
  • Start VS Code (1.90.0)

Output

[INFO 12:48:45 PM] [v0.12.0] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[Error 12:48:45 PM] [API] Failed to get Node.js version from /home/bennycode/.nvm/versions/node/v20.10.0/bin/node
[Error 12:48:45 PM] [Error Error] Failed to get Node.js version

Error: Failed to get Node.js version
	at wf (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:18:4670)
	at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
	at async _f (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:20:569)
	at async /home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:18:4126
	at async Promise.all (index 0)
	at async no (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:18:4161)
	at async wr.defineTestProfiles (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:26:2671)
	at async wr.activate (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:26:5698)
	at async od (/home/bennycode/.vscode-server/extensions/vitest.explorer-0.12.0/dist/extension.js:26:783)
	at async a.n (/home/bennycode/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/out/vs/workbench/api/node/extensionHostProcess.js:145:6361)
	at async a.m (/home/bennycode/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/out/vs/workbench/api/node/extensionHostProcess.js:145:6324)
	at async a.l (/home/bennycode/.vscode-server/bin/89de5a8d4d6205e5b11647eb6a74844ca23d2573/out/vs/workbench/api/node/extensionHostProcess.js:145:5781)
[Error 12:48:45 PM] [API] Failed to get Node.js version from /home/bennycode/.nvm/versions/node/v20.10.0/bin/node
[Error 12:48:45 PM] [API] Failed to get Node.js version from /home/bennycode/.nvm/versions/node/v20.10.0/bin/node

Version

0.12.0

Validations

@sheremet-va sheremet-va added p3-significant High priority enhancement (priority) p4-important Violate documented behavior or significantly improves performance (priority) and removed pending triage p3-significant High priority enhancement (priority) labels Jun 10, 2024
@maxdzin
Copy link

maxdzin commented Jun 12, 2024

Same.
It worked fine for VSCode v1.89 but started to drop the same error with the latest v1.90 update.
I also use nvm.

@sheremet-va
Copy link
Member

I cannot reproduce this locally, but I added some logs in 0.12.1. If you have anything new in the "Output" channel, please share.

@maxdzin
Copy link

maxdzin commented Jun 12, 2024

Thank you, @sheremet-va
With the update of Vitest extension to v0.12.1 it started working. I also updated the latest node LTS version, v20.14.0 (previous was v20.13.1), so it might be the case when some paths were updated or something.
There are output logs for the updated Vitest extension:

[INFO 5:03:33 PM] [v0.12.1] Vitest extension is activated because Vitest is installed or there is a Vite/Vitest config file in the workspace.
[INFO 5:03:47 PM] [API] Running Vitest v1.6.0 (dashboard/vitest.config.ts) with Node.js: /home/***/.nvm/versions/node/v20.14.0/bin/node
[Worker] Running with compatibility version `4`
[INFO 5:04:32 PM] [API] Vitest v1.6.0 (dashboard/vitest.config.ts) process 38056 created
[INFO 5:07:46 PM] Running 1 file(s): tests/unit/init.test.ts

@sheremet-va
Copy link
Member

This should be fixed in 0.12.2 for everyone in 5e3f10d, we don't throw an error anymore if the version was not returned.

@bennycode
Copy link
Author

@sheremet-va it looks like the error is not shown then any longer but does it actually fix the cause of the extension not finding the Node version? I noticed that when the error appears I am not able to use the extension via sidebar buttons on my test code files.

@sheremet-va
Copy link
Member

I noticed that when the error appears I am not able to use the extension via sidebar buttons on my test code files.

You should be able to see the reason in the Output panel. You can open it via "Vitest: Show Output Channel" command.

@github-actions github-actions bot locked and limited conversation to collaborators Jun 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
p4-important Violate documented behavior or significantly improves performance (priority)
Projects
None yet
Development

No branches or pull requests

3 participants