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, ENOENT: no such file or directory #553

Open
faileon opened this issue Feb 6, 2024 · 0 comments
Open

Failed to spawn process, ENOENT: no such file or directory #553

faileon opened this issue Feb 6, 2024 · 0 comments

Comments

@faileon
Copy link

faileon commented Feb 6, 2024

Hi everyone, I have the following code:

local Job = require "plenary.job"
Job:new({
  "npm",
  "info",
  "anuglar",
  "versions",
  "--json",
  on_exit = function(job)
    local result = job:result()
    print(vim.inspect(result))
  end,
}):start()

But it throws the following exception:

Failed to spawn process: {
  _additional_on_exit_callbacks = {},
  _shutdown_check = <userdata 1>,
  _stderr_results = {},
  _stdout_results = {},
  _user_on_exit = <function 1>,
  args = { "info", "anuglar", "versions", "--json" },
  command = "npm",
  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 = {},
}

My initial hunch was that NPM is not present in path, but it is. I can run the same command in terminal and I also verified the output of $env:PATH that nodejs and npm is present. I have also verified that vim sees the correct paths with vim.inspect(vim.env.PATH), which contains C:\\Program Files\\nodejs;, which is the location of my nodejs and npm .

My plenary version is latest at this moment i.e. 4f71c0c
Neovim version v0.9.5
OS: Microsoft Windows 11 Pro - 10.0.22631 N/A Build 22631

I think it might be windows related issue? Anyone have a clue please?

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

No branches or pull requests

1 participant