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

Error: Failed to execute git (ENOENT) #217

Open
lsq opened this issue Dec 18, 2024 · 0 comments
Open

Error: Failed to execute git (ENOENT) #217

lsq opened this issue Dec 18, 2024 · 0 comments

Comments

@lsq
Copy link

lsq commented Dec 18, 2024

Result from CocInfo

## versions

vim version: VIM - Vi IMproved 9.1 9010931
node version: v23.1.0
coc.nvim version: 0.0.82-aacbbcad 2024-11-23 13:34:02 +0800
coc.nvim directory: C:\msys64\home\Administrator\.vim\plugged\coc.nvim
term: xterm-256color
platform: win32

## Log of coc.nvim

2024-12-18T17:58:21.376 INFO (pid:41928) [extension:coc-git] - Looking for git in: C:\msys64\usr\bin\git.exe",
2024-12-18T17:58:21.424 INFO (pid:41928) [plugin] - coc.nvim initialized with node: v23.1.0 after 1573
2024-12-18T17:58:21.435 INFO (pid:41928) [attach] - receive notification: highlight []
2024-12-18T17:58:21.572 INFO (pid:41928) [extension:coc-git] - Error:  spawn git ENOENT
2024-12-18T17:58:21.574 INFO (pid:41928) [extension:coc-git] - Error:  spawn git ENOENT
2024-12-18T17:58:21.575 ERROR (pid:41928) [server] - unhandledRejection  Promise {
  <rejected> Error: Failed to execute git (ENOENT)
      at ChildProcess.<anonymous> (C:\Users\Administrator\.config\coc\extensions\node_modules\coc-git\lib\index.js:4707:13)
      at Object.onceWrapper (node:events:622:26)
      at ChildProcess.emit (node:events:507:28)
      at ChildProcess._handle.onexit (node:internal/child_process:292:12)
      at onErrorNT (node:internal/child_process:484:16)
      at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
} Error: Failed to execute git (ENOENT)
    at ChildProcess.<anonymous> (C:\Users\Administrator\.config\coc\extensions\node_modules\coc-git\lib\index.js:4707:13)
    at Object.onceWrapper (node:events:622:26)
    at ChildProcess.emit (node:events:507:28)
    at ChildProcess._handle.onexit (node:internal/child_process:292:12)
    at onErrorNT (node:internal/child_process:484:16)
    at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
2024-12-18T17:58:25.001 INFO (pid:41928) [attach] - receive notification: showInfo []

Describe the bug

When execute function findSpecificGit(path9, onLookup), the

const child = import_child_process.spawn(path9, ["--version"]);
child.stdout.on("data", (b) => buffers.push(b));
child.on("error", cpErrorHandler(e));

catch Error;
I have try related neoclide/coc.nvim#5225 with shell: true, cannot resolve the problem.
Add console.log(b.toString()); to child.stdout.on above callback function, the result:
git version 2.47.1
And I test with code,

const {spawn} = require('node:child_process');
const child = spawn('git', ['--version']); 
child.stdout.on('data', (d) =>{
    console.log(d.toString());
});
child.on('error', (e)=> console.error(e.message));
console.log("End ...");

this is no error;

Reproduce the bug

We will close your issue when you don't provide minimal vimrc and we can't
reproduce it

  • Create file mini.vim with:
set nocompatible
set runtimepath^=~/.vim/plugged/coc.nvim
filetype plugin indent on
syntax on
set hidden
let g:coc_global_extension = ['coc-git']
let g:coc_data_home="~/.config/coc"
  • Set coc-settings.json
"git.command": "C:\\msys64\\usr\\bin\\git.exe",
  • Start (neo)vim with command: vim -u ~/mini.vim package.json

  • Operate vim.

Screenshots (optional)

image

lsq pushed a commit to lsq/coc-git that referenced this issue Dec 19, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
lsq pushed a commit to lsq/coc-git that referenced this issue Dec 20, 2024
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