mtxr / vscode-sqltools

Database management for VSCode
https://vscode-sqltools.mteixeira.dev?utm_source=github&utm_medium=homepage-link
MIT License
1.49k stars 300 forks source link

Node runtime detection fails with PowerShell 7 on macOS and maybe Linux too #1036

Open gjsjohnmurray opened 1 year ago

gjsjohnmurray commented 1 year ago

node -e 'require("fs").writeFileSync("/Users/mikes/Library/Application Support/vscode-sqltools/.node-runtime", process.execPath)' && $(exit 0) Result error

node -e "require('fs').writeFileSync('/Users/mikes/Library/Application Support/vscode-sqltools/.node-runtime', process.execPath)" && $(exit 0) Result succeed

Originally posted by @mikes-gh in https://github.com/mtxr/vscode-sqltools/issues/1024#issuecomment-1313375129

gjsjohnmurray commented 1 year ago

See also #1038 (failure when using Git Bash shell on Windows).

Mingun commented 1 year ago

I can confirm that node runtime detection is buggy on Ubuntu 20.04.4: it happens each time when I start VS Code and stuck in process the whole system (even OS!) sometimes for around 5 sec, but somehow the runtime detection is successful? See the screenshot just after starting VS Code: VS Code started with SQLTools

The language server crash is reported each time, but I suppose this is #971.

I noticed, that extension runs the command similar to

node -e 'require("fs").writeFileSync("/home/mingun/.local/share/vscode-sqltools/.node-runtime", process.execPath)' && $(exit 0)

in the integrated VS Code terminal, but the it closes so quickly so I have no time to see the exactly command (I only sure that it writes something to the home folder and that the name of file is .node-runtime and there a something named vscode-sqltools or .vscode-sqltools in the path). I've checked my home folder for a .node-runtime file and find the file /home/mingun/.local/share/vscode-sqltools/.node-runtime with the following content:

/usr/bin/node

File have change time equal to a time when VS Code was opened

stormwild commented 1 year ago

Getting an error vscode with Git bash as default terminal, SQLTools v0.27.1

image

image