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 spawn process in lazyvim on windows #602

Open
gogamid opened this issue Sep 3, 2023 · 4 comments
Open

Failed to spawn process in lazyvim on windows #602

gogamid opened this issue Sep 3, 2023 · 4 comments

Comments

@gogamid
Copy link

gogamid commented Sep 3, 2023

Describe the bug

when i run the following command coursier bootstrap .... scalameta .. on cmd on windows, it seems working, but when i run install metals inside nvim, i get this error.

...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:404: Failed to spawn process: {
  _additional_on_exit_callbacks = {},
  _shutdown_check = <userdata 1>,
  _stderr_results = {},
  _stdout_results = {},
  _user_on_exit = <function 1>,
  _user_on_stderr = <function 2>,
  _user_on_stdout = <function 3>,
  args = { "bootstrap", "--java-opt", "-Xss4m", "--java-opt", "-Xms100m", "org.scalameta:metals_2.13:latest.release", "-r", "sonatype:snapshots", "-o", "C:\\Users\\dtwj6af\\AppData\\Local\\Temp\\nvim\\nvim-metals\\metals", "-f" },
  command = "coursier",
  enable_handlers = true,
  enable_recording = true,
  interactive = true,
  pid = "ENOENT: no such file or directory",
  stderr = <userdata 2>,
  stdin = <userdata 3>,
  stdout = <userdata 4>,
  user_data = {},
  <metatable> = <1>{
    __index = <table 1>,
    _create_uv_options = <function 4>,
    _execute = <function 5>,
    _pipes_are_closed = <function 6>,
    _prepare_pipes = <function 7>,
    _reset = <function 8>,
    _shutdown = <function 9>,
    _stop = <function 10>,
    add_on_exit_callback = <function 11>,
    after = <function 12>,
    after_failure = <function 13>,
    after_success = <function 14>,
    and_then = <function 15>,
    and_then_on_failure = <function 16>,
    and_then_on_failure_wrap = <function 17>,
    and_then_on_success = <function 18>,
    and_then_on_success_wrap = <function 19>,
    and_then_wrap = <function 20>,
    chain = <function 21>,
    chain_status = <function 22>,
    co_wait = <function 23>,
    is_job = <function 24>,
    join = <function 25>,
    new = <function 26>,
    pid = <function 27>,
    result = <function 28>,
    send = <function 29>,
    shutdown = <function 30>,
    start = <function 31>,
    stderr_result = <function 32>,
    sync = <function 33>,
    wait = <function 34>
  }
}
stack traceback:
	...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:404: in function '_execute'
	...ta/Local/nvim-data/lazy/plenary.nvim/lua/plenary/job.lua:447: in function 'start'
	.../Local/nvim-data/lazy/nvim-metals/lua/metals/install.lua:50: in function 'do_install'
	.../Local/nvim-data/lazy/nvim-metals/lua/metals/install.lua:152: in function <.../Local/nvim-data/lazy/nvim-metals/lua/metals/install.lua:99>
	[C]: in function 'pcall'
	...ta/lazy/nvim-metals/lua/telescope/_extensions/metals.lua:27: in function 'key_func'
	...nvim-data/lazy/telescope.nvim/lua/telescope/mappings.lua:257: in function <...nvim-data/lazy/telescope.nvim/lua/telescope/mappings.lua:256>

Expected behavior

Metals should be installed without problems

Operating system

Windows

Version of Metals

1.0.1

Commit of nvim-metals

57cff9a

@ckipp01
Copy link
Member

ckipp01 commented Sep 4, 2023

when i run the following command coursier bootstrap .... scalameta .. on cmd on windows, it seems working, but when i run install metals inside nvim, i get this error.

Could you give some more details on how you're running this? Is this what you're seeing when you run :MetalsInstall?

@gogamid
Copy link
Author

gogamid commented Sep 4, 2023

sorry for short info,
yes i run :MetalsInstall

@ckipp01
Copy link
Member

ckipp01 commented Sep 18, 2023

sorry for short info, yes i run :MetalsInstall

Hey, sorry I haven't gotten back to this. I'm not really sure how to reproduce as I don't have a windows machine and also don't use lazyvim.

@ckipp01 ckipp01 changed the title Failed to spawn process in lazyvim Failed to spawn process in lazyvim on windows Nov 16, 2023
@dragove
Copy link

dragove commented Apr 10, 2024

If you installed coursier with scoop, a quick way to fix this is create a link named cs.bat to coursier.cmd.

to achieve this, following these steps:

  1. enter cmd environment with cmd
  2. cd %USERPROFILE%\scoop\shims
  3. mklink cs.bat coursier.cmd

After these steps, relaunch your terminal and enter nvim and run MetalsInstall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants