sourcegit: error: `env: node: No such file or directory`

When I try to commit some changes, I have the following error: env: node: No such file or directoryas you see on this screenshot:

image

I guess it’s due to a pre-commit in my repo that uses yarn/node. Usually node is on my PATH, because I run nvm setup scripts in both .bashrc and .zshrc.

Any idea of why Sourcegit can’t find node? Does it use a special shell or path? 🤔

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Comments: 19 (2 by maintainers)

Most upvoted comments

@BeLi4L If it’s convenient for you, you can download the latest CI build from Github Action - instead of needing to start from the command line, it will read the PATH variable from zsh at startup

I noticed that VS Code doesn’t have this issue (whereas sourcegit & some other git GUIs have it) @love-linger

Any idea why? Are they doing anything differently? 🤔

I guess it’s because vscode reads various shell configuration files by itself.

https://github.com/microsoft/vscode/blob/3ae1a2259222266236891f983a0a9229b491998d/src/vs/workbench/contrib/terminal/common/scripts/shellIntegration-bash.sh