You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've got a pre-commit git hook that bundles code for me, and my bundling process requires v0.12 at the moment as there's an issue with iojs one of my deps can't take. I've set my default using nvm alias default v0.12, but I think my system is still using iojs, because when I commit I get the error I would expect if I did. I think the issue is that but my git hook shell script can't seem to find nvm, and defaults to system.
I added these lines to the hook:
which node
nvm ls
And got:
$ sh .git/hooks/pre-commit
/Users/richard/.nvm/versions/node/v0.12.0/bin/node
.git/hooks/pre-commit: line 7: nvm: command not found
And now I am confused - why is nvm not found?
The text was updated successfully, but these errors were encountered:
What kind of shell does the git hook execute with? If it's a non-interactive shell, it probably doesn't source nvm.sh. Try adding . $NVM_DIR/nvm.sh to your git hook. (it might be explicitly preserving your PATH but not the shell environment)
I've got a pre-commit git hook that bundles code for me, and my bundling process requires v0.12 at the moment as there's an issue with iojs one of my deps can't take. I've set my default using
nvm alias default v0.12
, but I think my system is still using iojs, because when I commit I get the error I would expect if I did. I think the issue is that but my git hook shell script can't seem to find nvm, and defaults to system.I added these lines to the hook:
And got:
$ sh .git/hooks/pre-commit /Users/richard/.nvm/versions/node/v0.12.0/bin/node .git/hooks/pre-commit: line 7: nvm: command not found
And now I am confused - why is nvm not found?
The text was updated successfully, but these errors were encountered: