No, I have completely removed NVM for now.
All traces of it. I just installed the latest official NodeJS LTS version aka 20.9.0.
ST4: LSP fails to install (any) language server
Okay.
{
// Specifies the type and priority of the Node.js installation that should be used for Node.js-based servers.
// The allowed values are:
// - 'system' - a Node.js runtime found on the PATH
// - 'local' - a Node.js runtime managed by LSP that doesn't affect the system
// The order in which the values are specified determines which one is tried first,
// with the later one being used as a fallback.
// You can also specify just a single value to disable the fallback.
"nodejs_runtime": ["local"],
"local_use_electron": false,
}
This settings should work under any circumstances regardless of user’s environment. Otherwise, there may be something wrong in lsp_utils.
So, I tried with specifying the electron flag to false explicitly.
Restarted ST4 and everything looked fine.
Tried with true and restarted ST4. It downloaded Node JS runtime again and everything seemed fine.
Changed the flag back to false and now I get this:
Console log below:
[lsp_utils] Deleting outdated Node.js runtime directory “C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils\node-runtime\18.17.1”
— lsp_utils Node.js resolving start —
Resolving Node.js Runtime from lsp_utils for package LSP-json…
* Binaries check failed: “node” binary not found
* Failed downloading: [WinError 3] The system cannot find the path specified: ‘C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils\node-runtime\18.17.1\cache\yarn\v6\npm-typescript-5.2.0-dev.20230807-652fa8a3fcc46958035d9b911c815299deb9f58e-integrity\node_modules\typescript\lib\pt-br\diagnosticMessages.generated.json’
— lsp_utils Node.js resolving end —
Unable to start subprocess for LSP-json
Traceback (most recent call last):
File “C:\Users\diakosi7344\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py”, line 248, in start_async
if plugin_class.needs_update_or_installation():
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils_client_handler\abstract_plugin.py”, line 101, in needs_update_or_installation
server = cls.get_server()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\npm_client_handler.py”, line 130, in get_server
‘skip_npm_install’: cls.skip_npm_install,
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 47, in create
node_runtime = NodeRuntime.get(package_name, storage_path, required_node_version)
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\node_runtime.py”, line 58, in get
cls._node_runtime = cls._resolve_node_runtime(package_name, storage_path, required_semantic_version)
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\node_runtime.py”, line 125, in _resolve_node_runtime
raise Exception(‘Failed resolving Node.js Runtime. Please check in the console for more details.’)
Exception: Failed resolving Node.js Runtime. Please check in the console for more details.
Renamed the node_runtime folder located in C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils after exiting ST4.
Restarted it and now it works as expected.
Thanks. I can reproduce this. I think this is the culprit.
Step to reproduce:
- First use
{
"nodejs_runtime": ["local"],
"local_use_electron": true,
}
- After it’s working, now use
{
"nodejs_runtime": ["local"],
"local_use_electron": false,
}
-
lsp_utils
doesn’t switch to download node.js but emits an error.
The manual fix is to empty the Package Storage\lsp_utils\node-runtime
directory.
No. I can reproduce that stably. An issue has been created on https://github.com/sublimelsp/lsp_utils/issues/109
A fix has been merged and will be in the next release.
- Failed downloading: [WinError 3] The system cannot find the path specified: ‘C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils\node-runtime\18.17.1\cache\yarn\v6\npm-typescript-5.2.0-dev.20230807-652fa8a3fcc46958035d9b911c815299deb9f58e-integrity\node_modules\typescript\lib\pt-br\diagnosticMessages.generated.json’
The root cause is the path is too long (>255 chars). The fix is to use its UNC form by prepending \\?\
to it. E.g., \\?\C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils\node-runtime\18.17.1\cache\yarn\v6\npm-typescript-5.2.0-dev.20230807-652fa8a3fcc46958035d9b911c815299deb9f58e-integrity\node_modules\typescript\lib\pt-br\diagnosticMessages.generated.json
.