mtxr / vscode-sqltools

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

Throwing error immediately after installation #1038

Closed Shujee closed 1 year ago

Shujee commented 1 year ago

Getting the following error in the Terminal immediately after installing the extension:

$ node -e 'require(\"fs\").writeFileSync(\"C:\\Users\\<USERNAME>\\AppData\\Local\\vscode-sqltools\\Data\\.node-runtime\", process.exec
Path)' && exit 0
[eval]:1
require(\"fs\").writeFileSync(\"C:\\Users\\<USERNAME>\\AppData\\Local\\vscode-sqltools\\Data\\.node-runtime\", process.execPath)
        ^

SyntaxError: Invalid or unexpected token
←[90m    at new Script (node:vm:100:7)←[39m
←[90m    at createScript (node:vm:257:10)←[39m
←[90m    at Object.runInThisContext (node:vm:305:10)←[39m
←[90m    at node:internal/process/execution:75:19←[39m
    at [eval]-wrapper:6:22
←[90m    at evalScript (node:internal/process/execution:74:60)←[39m
←[90m    at node:internal/main/eval_string:27:3←[39m

Desktop (please complete the following information):

Additional context Reinstalling the extension and/or restarting VSCode doesn't help. Creating/removing the .node-runtime folder doesn't help either. Shows this message when VSCode starts:

image

gjsjohnmurray commented 1 year ago

On the dropdown on the Terminal tab of the Panel, which shell is marked as your default?

Shujee commented 1 year ago

Git Bash

gjsjohnmurray commented 1 year ago

The algorithm for detecting the path of a node runtime isn't handling the case where a Windows instance of VS Code is using Git Bash as the default shell.

@Shujee a workaround for you is to edit your user-lever settings.json file and look for sqltools.useNodeRuntime. If you find it, delete the line. If you still get the problem, check the file .vscode/settings.json in the workspace you opened in VS Code, and remove that setting from it.

Knowledge of where your node runtime is located is only required if you are using the SQLite driver.

Shujee commented 1 year ago

Thanks @gjsjohnmurray . Fixed it for me.

gjsjohnmurray commented 1 year ago

Resolved by #1059