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

Cannot find node in pre-commit check when committing in vscode's source control panel #602

Closed
daolanfler opened this issue Dec 15, 2021 · 3 comments

Comments

@daolanfler
Copy link

daolanfler commented Dec 15, 2021

I'm using vscode's source control panel to do commit (with a precommit check) , but I got this error:

image

I'm using git bash as vscode's integrated termial, I can do commit in command line but not in the gui.
And I've also set the powershell profile as described in readme because I'm not sure if the vsocde git commit gui uses powershell or git bash, but that doesn't work either.

Is there any workaround in fnm or should I tweak with the vscode settings?

@daolanfler
Copy link
Author

I see. After digging into the git log error and look into the pre-commit hook, I find that the hook script is not evaluating fnm. Add following lines (found here #390 ), problem temporarily solved:

**apparently no node in this PATH**
# Node standard installation
export PATH="$PATH:/c/Program Files/nodejs"

+ # evaluate fnm 
+ eval $(fnm env | sed 1d)
+ export PATH=$(cygpath $FNM_MULTISHELL_PATH):$PATH

# Export Git hook params
export GIT_PARAMS="$*"

And this seems to be similar with #428

@daolanfler
Copy link
Author

And this project is using yorkie which is a fork of husky

@meteorlxy
Copy link

For someone like me, remember to change the default profile of VSCode integrated terminal:

"terminal.integrated.defaultProfile.osx": "zsh"

https://code.visualstudio.com/docs/editor/integrated-terminal#_configuring-profiles

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

2 participants