Sublime Forum

ST4: LSP fails to install (any) language server

#1

Hello there.

I have been trying to enable LSP support (e.g. lsp-json, lsp-html, lsp-angular etc) but it consistently fails with the error message below. I have no ideas on how to fix it as I am still trying to figure out what is the issue here. Any ideas anyone? :slight_smile:

0 Likes

#2

If you don’t mind letting LSP manages its own local node.js copy, adding this file would be the easiest solution in my opinion.

2 Likes

#3

I think the issue is that npm tries to use a command that is not allowed with global packages aka npm ci so I guess that is a bug.
Nonetheless, I looked at your file and applied the changes to my LSP utility settings. Restarted ST4 and it worked like a charm :slight_smile:
Much appreciated!

P.S.: I will also have a look at your repo. Maybe I find an interesting setting or two for my ST4 editor :smiley:

0 Likes

#4

I haven’t seen such error when just installing LSP and its LSP-… helper packages, no matter what settings in lsp_utils.sublime-settings are used.

All helper packages ship both, packages.json and packages-lock.json and use them to install pinned versions of required packages to Data\Package Storage.

The only situation I’ve seen such errors so far was when packages-lock.json was missing or packages.json was manipulated.

0 Likes

#5

Dunno.
I have two installations of ST4 in two different computers of mine and it exhibits the exact same behaviour so… :slight_smile:

Maybe it’s a permissions thing or something else that causes npm to fail?

Unfortunately, after an update to the Package Control this error is back (sigh) :confused:

P.S.: packages-lock.json exists in local directory and I have never manipulated manually packages.json as ar as I am concerned.

P.S.2: I have tried to run manually the command and it still fails as the log above suggests. I will try and investigate gentlepeople and get back to you if I find anything important.

DPI mode: per-monitor v2
startup, version: 4152 windows x64 channel: stable
executable: /C/Program Files/Sublime Text/sublime_text.exe
application: /C/Program Files/Sublime Text
working dir: /C/Program Files/Sublime Text
packages path: /C/Users/diakosi7344/AppData/Roaming/Sublime Text/Packages
state path: /C/Users/diakosi7344/AppData/Roaming/Sublime Text/Local
zip path: /C/Program Files/Sublime Text/Packages
zip path: /C/Users/diakosi7344/AppData/Roaming/Sublime Text/Installed Packages
ignored_packages: [“Vintage”]
pre session restore time: 0.194436
startup time: 0.352436
first paint time: 0.352436
git: located Sublime Merge installed at C:\Program Files\Sublime Merge
git: using configuration from C:\Program Files\Sublime Merge\Git\cmd\git.exe
git: tracking working dir C:\Users\diakosi7344\workspace\angular\client
reloading plugin Default.arithmetic
reloading plugin Default.auto_indent_tag
reloading plugin Default.block
reloading plugin Default.colors
reloading plugin Default.comment
reloading plugin Default.convert_color_scheme
reloading plugin Default.convert_syntax
reloading plugin Default.copy_path
reloading plugin Default.echo
reloading plugin Default.exec
reloading plugin Default.fold
reloading plugin Default.font
reloading plugin Default.goto_line
reloading plugin Default.history_list
reloading plugin Default.html_print
reloading plugin Default.indentation
reloading plugin Default.install_package_control
reloading plugin Default.keymap
reloading plugin Default.kill_ring
reloading plugin Default.mark
reloading plugin Default.new_templates
reloading plugin Default.open_context_url
reloading plugin Default.open_in_browser
reloading plugin Default.pane
reloading plugin Default.paragraph
reloading plugin Default.paste_from_history
reloading plugin Default.profile
reloading plugin Default.quick_panel
reloading plugin Default.rename
reloading plugin Default.run_syntax_tests
reloading plugin Default.save_on_focus_lost
reloading plugin Default.scroll
reloading plugin Default.set_unsaved_view_name
reloading plugin Default.settings
reloading plugin Default.show_scope_name
reloading plugin Default.side_bar
reloading plugin Default.sort
reloading plugin Default.switch_file
reloading plugin Default.symbol
reloading plugin Default.transform
reloading plugin Default.transpose
reloading plugin Default.ui
reloading plugin CSS.css_completions
reloading plugin Diff.diff
reloading plugin HTML.encode_html_entities
reloading plugin HTML.html_completions
reloading python 3.3 plugin 0_package_control_loader.00-package_control
reloading python 3.3 plugin 0_package_control_loader.01-sublime_lib
reloading python 3.3 plugin 0_package_control_loader.10-lsp_utils
reloading python 3.3 plugin 0_package_control_loader.50-bracex
reloading python 3.3 plugin 0_package_control_loader.50-pathlib
reloading python 3.3 plugin 0_package_control_loader.55-mdpopups
reloading python 3.3 plugin 0_package_control_loader.55-wcmatch
reloading python 3.3 plugin LSP-angular.plugin
reloading python 3.3 plugin LSP-css.plugin
reloading python 3.3 plugin LSP-css.types
reloading python 3.3 plugin LSP-dockerfile.plugin
reloading python 3.3 plugin LSP-file-watcher-chokidar.watcher
reloading python 3.3 plugin LSP-html.plugin
reloading python 3.3 plugin LSP-html.types
reloading python 3.3 plugin LSP-json.commands
reloading python 3.3 plugin LSP-json.plugin
reloading python 3.3 plugin LSP-json.schema_store
reloading python 3.3 plugin LSP-OmniSharp.plugin
reloading python 3.3 plugin LSP-typescript.commands
reloading python 3.3 plugin LSP-typescript.plugin
reloading python 3.3 plugin LSP-typescript.plugin_types
reloading python 3.3 plugin LSP-yaml.plugin
reloading python 3.3 plugin LSP.boot
reloading python 3.3 plugin Package Control.1_reloader
reloading python 3.3 plugin Package Control.2_bootstrap
reloading python 3.3 plugin Package Control.Package Control
reloading python 3.3 plugin Theme - Monokai Pro.Monokai Pro
plugins loaded
[lsp_utils] Deleting outdated Node.js runtime directory “C:\Users\diakosi7344\AppData\Local\Sublime Text\Package Storage\lsp_utils\node-runtime\16.17.1”
[lsp_utils] START output of command: “ci --omit=dev --scripts-prepend-node-path=true --verbose”

[lsp_utils] Command output END
Unable to start subprocess for LSP-html
Traceback (most recent call last):
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 123, in install_or_update
self._node_runtime.run_install(cwd=self._server_dest)
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\node_runtime.py”, line 217, in run_install
raise Exception(‘Failed to run npm command “{}”:\n{}’.format(’ '.join(args), error))
Exception: Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using npm@9.8.1
npm info using node@v18.18.1
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\ProgramData\nvm\v18.18.1\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb loadVirtual at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:53:18
npm verb stack at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb stack at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v18.18.1
npm verb npm v9.8.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-debug-0.log

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\diakosi7344\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py”, line 250, in start_async
plugin_class.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils_client_handler\abstract_plugin.py”, line 109, in install_or_update
server.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 127, in install_or_update
raise Exception(‘Error installing the server:\n{}’.format(error))
Exception: Error installing the server:
Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using npm@9.8.1
npm info using node@v18.18.1
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\ProgramData\nvm\v18.18.1\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb loadVirtual at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:53:18
npm verb stack at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb stack at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v18.18.1
npm verb npm v9.8.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_46_56_104Z-debug-0.log

Package Control: Skipping automatic upgrade, last run at 2023-10-25 11:41:11, next run at 2023-10-25 12:41:11 or after
[lsp_utils] START output of command: “ci --omit=dev --scripts-prepend-node-path=true --verbose”

[lsp_utils] Command output END
Unable to start subprocess for LSP-typescript
Traceback (most recent call last):
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 123, in install_or_update
self._node_runtime.run_install(cwd=self._server_dest)
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\node_runtime.py”, line 217, in run_install
raise Exception(‘Failed to run npm command “{}”:\n{}’.format(’ '.join(args), error))
Exception: Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using npm@9.8.1
npm info using node@v18.18.1
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\ProgramData\nvm\v18.18.1\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb loadVirtual at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:53:18
npm verb stack at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb stack at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v18.18.1
npm verb npm v9.8.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-debug-0.log

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\diakosi7344\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py”, line 250, in start_async
plugin_class.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils_client_handler\abstract_plugin.py”, line 109, in install_or_update
server.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 127, in install_or_update
raise Exception(‘Error installing the server:\n{}’.format(error))
Exception: Error installing the server:
Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\node.exe C:\Program Files\nodejs\node_modules\npm\bin\npm-cli.js
npm info using npm@9.8.1
npm info using node@v18.18.1
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\ProgramData\nvm\v18.18.1\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb loadVirtual at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:53:18
npm verb stack at async CI.exec (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\commands\ci.js:47:5)
npm verb stack at async module.exports (C:\ProgramData\nvm\v18.18.1\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v18.18.1
npm verb npm v9.8.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T10_49_50_272Z-debug-0.log

0 Likes

#6

So I tried everything as far as NodeJs is concerned.
I had nvm installed to manage my NodeJS versions but I removed them and I installed the official NodeJS LTS 20.9 version (msi executable) and I still get the same error.
So I think something is broken or gets broken in ST4 during usage.

But now a clean official installation is not working :confused:
Really weird.
I will probably leave the official LTS installation for now and not use nvm until this is resolved.

0 Likes

#7

What if you change lsp_utils settings to

{
    // 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", "system"],
    "local_use_electron": false,
}

And let lsp_utils install its own Node.js?

0 Likes

#8

I have done that and initially it worked but then Package Control auto-upgraded and it broke again. Changing the nodejs_runtime setting back and forth has no effect now! DefoI hit a bug there :stuck_out_tongue:

I am in the process of uninstalling and reinstalling all packages and if that does not work I will uninstall ST4 and reinstall (sigh).

P.S.: NodeJS path is correct per logs. What happens if you try and run this command either in system path or local path? Does it work for you? I have tried it manually running the npm ci command in a clean install of NodeJS and it does not work. This indicates to me that LSP is broken as it cannot run a command at system level with a proper clean install of NodeJS!

Also, not sure why the local install broke when Package Control auto-upgraded :confused:
I will try and delete the node_modules and retry.

0 Likes

#9

I am going to call it a day for now.
Uninstalled everything and reinstalled ST4 after deleting the relative Roaming folder too. Still I face the same bug. So annoyed :confused:

0 Likes

#10

Just want to say, I don’t see any error message post which indicates lsp_utils-managed node.js/electron failed. All errors I saw is from user env’s.

0 Likes

#11

Can you please run npm ci --omit=dev --scripts-prepend-node-path=true --verbose in your system NodeJS installation? Or a local one? And let me know of the result please. That command fails to run and I do not understand why (I tried doing it manually and get the same error).

P.S.: I also tried a Windows Sandbox environment. Everything works but I am admin by default. That is the only difference that comes to mind as far as I can understand.

0 Likes

#12


Works fine both in git-bash and cmd.

0 Likes

#13

One thing you may try is to delete the whole Package Storage directory to see if there is a difference.

0 Likes

#14

I guess my environment is the problematic one here but I do not understand why.
By Package Storage do you mean the Roaming\Sublime Text\Packages folder?

0 Likes

#15

No. You can see the full path in my previous screenshots. Or, you may just execute this in your ST console.

from pathlib import Path; shutil.rmtree(Path(sublime.cache_path()) / "../Package Storage")
0 Likes

#16

I did that.
But it did not work.
I even deleted the whole folder and when I restarted ST4 it recreated it.
Still the same thing.

P.S.: I even uninstalled LSP-json, LSP and Package Control and deleted the whole Sublime Text folder in AppData/Local. However, I still face the same error when I restart ST4 and reinstall all those packages… :confused:

P.S.2: Tried the nuclear option. Uninstalled ST4 and removed the Sublime Text folder in Local and Roaming directores. Reinstalled. Tried the same steps. No luck!

0 Likes

#17

I would suggest just use lsp_utils-managed env then.

0 Likes

#18

That is fine with me but … if you mean to change system to local then that has broken too for some reason. It worked when I first faced this issue but after Package Control got an update I saw the same problem appear again!

0 Likes

#19

No error msg is post though.

0 Likes

#20

It’s the same as the one I posted above. I am attaching it here again (the NodeJS version used is a fresh one now as stated before).

[lsp_utils] START output of command: “ci --omit=dev --scripts-prepend-node-path=true --verbose”

[lsp_utils] Command output END
Unable to start subprocess for LSP-json
Traceback (most recent call last):
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 123, in install_or_update
self._node_runtime.run_install(cwd=self._server_dest)
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\node_runtime.py”, line 217, in run_install
raise Exception(‘Failed to run npm command “{}”:\n{}’.format(’ '.join(args), error))
Exception: Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\20_9\node.exe C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm info using npm@10.2.1
npm info using node@v20.9.0
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:48:5)
npm verb loadVirtual at async module.exports (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–include <prod|dev|optional|peer> [–include <prod|dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:54:18
npm verb stack at async CI.exec (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:48:5)
npm verb stack at async module.exports (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v20.9.0
npm verb npm v10.2.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–include <prod|dev|optional|peer> [–include <prod|dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-debug-0.log

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File “C:\Users\diakosi7344\AppData\Roaming\Sublime Text\Installed Packages\LSP.sublime-package\plugin/core/windows.py”, line 250, in start_async
plugin_class.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils_client_handler\abstract_plugin.py”, line 109, in install_or_update
server.install_or_update()
File “C:\Users\DIAKOS~1\AppData\Roaming\SUBLIM~1\Packages\LSP_UT~1\st3\lsp_utils\server_npm_resource.py”, line 127, in install_or_update
raise Exception(‘Error installing the server:\n{}’.format(error))
Exception: Error installing the server:
Failed to run npm command “ci --omit=dev --scripts-prepend-node-path=true --verbose”:
npm verb cli C:\Program Files\nodejs\20_9\node.exe C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\bin\npm-cli.js
npm info using npm@10.2.1
npm info using node@v20.9.0
npm verb title npm ci
npm verb argv “ci” “–omit” “dev” “–scripts-prepend-node-path” “true” “–loglevel” “verbose”
npm verb logfile logs-max:10 dir:C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-
npm verb logfile C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-debug-0.log
npm verb loadVirtual Error: loadVirtual requires existing shrinkwrap file
npm verb loadVirtual at Arborist.loadVirtual (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\node_modules@npmcli\arborist\lib\arborist\load-virtual.js:51:18)
npm verb loadVirtual at async CI.exec (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:48:5)
npm verb loadVirtual at async module.exports (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js:61:5)
npm verb stack Error:
npm verb stack The npm ci command can only install with an existing package-lock.json or
npm verb stack npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm verb stack later to generate a package-lock.json file, then try again.
npm verb stack
npm verb stack Clean install a project
npm verb stack
npm verb stack Usage:
npm verb stack npm ci
npm verb stack
npm verb stack Options:
npm verb stack [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm verb stack [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm verb stack [–include <prod|dev|optional|peer> [–include <prod|dev|optional|peer> …]]
npm verb stack [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm verb stack [–no-bin-links] [–no-fund] [–dry-run]
npm verb stack [-w|–workspace [-w|–workspace …]]
npm verb stack [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm verb stack
npm verb stack aliases: clean-install, ic, install-clean, isntall-clean
npm verb stack
npm verb stack Run “npm help ci” for more info
npm verb stack at CI.usageError (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\base-command.js:113:26)
npm verb stack at C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:54:18
npm verb stack at async CI.exec (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\commands\ci.js:48:5)
npm verb stack at async module.exports (C:\Users\diakosi7344\AppData\Roaming\npm\node_modules\npm\lib\cli-entry.js:61:5)
npm verb cwd C:\Users\diakosi7344
npm verb Windows_NT 10.0.22621
npm verb node v20.9.0
npm verb npm v10.2.1
npm ERR! code EUSAGE
npm ERR!
npm ERR! The npm ci command can only install with an existing package-lock.json or
npm ERR! npm-shrinkwrap.json with lockfileVersion >= 1. Run an install with npm@5 or
npm ERR! later to generate a package-lock.json file, then try again.
npm ERR!
npm ERR! Clean install a project
npm ERR!
npm ERR! Usage:
npm ERR! npm ci
npm ERR!
npm ERR! Options:
npm ERR! [–install-strategy <hoisted|nested|shallow|linked>] [–legacy-bundling]
npm ERR! [–global-style] [–omit <dev|optional|peer> [–omit <dev|optional|peer> …]]
npm ERR! [–include <prod|dev|optional|peer> [–include <prod|dev|optional|peer> …]]
npm ERR! [–strict-peer-deps] [–foreground-scripts] [–ignore-scripts] [–no-audit]
npm ERR! [–no-bin-links] [–no-fund] [–dry-run]
npm ERR! [-w|–workspace [-w|–workspace …]]
npm ERR! [-ws|–workspaces] [–include-workspace-root] [–install-links]
npm ERR!
npm ERR! aliases: clean-install, ic, install-clean, isntall-clean
npm ERR!
npm ERR! Run “npm help ci” for more info
npm verb exit 1
npm verb code 1

npm ERR! A complete log of this run can be found in: C:\Users\diakosi7344\AppData\Local\npm-cache_logs\2023-10-25T16_25_19_145Z-debug-0.log

0 Likes