-
Notifications
You must be signed in to change notification settings - Fork 220
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
npm: not found
when using a git client and nvm
#178
Comments
npm: not found
when using a git clientnpm: not found
when using a git client and nvm
Can you please tell us a bit more details?
I believe that problem is in environment set up by your git client when it executes git commands (probably with |
Using a Linux fork of GitHub Desktop v2.5.3. Using the debian package.
Lefthook is a dependancy in our
GitHub Desktop /usr/lib/github-desktop/resources/app/git/libexec/git-core:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin When just using the command line
|
Oh, I was afraid of that 😞
I wonder whether it could be caused by #146 |
I've done some playing about and it didn't actually work with
It seems that launching the git client via the command line correctly populates the It looks as though Husky also suffers the same issue due to The workaround for Husky involves a |
Had this problem while trying to run a global PHP composer command, which is in my path but not found when run via lefthook. Fortunately, composer has a way to get the bin directory, so I can dynamically call it and set the path before running my command and then it works. x-phpcs: &phpcs
run: export PATH="$PATH:$(composer global config bin-dir --absolute --quiet)" && phpcs -s --standard=./phpcs.xml.dist {staged_files}
pre-commit:
parallel: true
commands:
phpcs:
glob: "app/*.php"
<<: *phpcs
# etc... |
Since
v0.7.3
it appears Lefthook is struggling to find npm when using a git client (e.g. GitHub Desktop/SmartGit) while usingnvm
.It works as expected when making a commit directly from the command line
or when using.v0.7.2
OS: Ubuntu
Error
lefthook.yml
NPM
We are currently using
nvm
to manage ournpm
installation.If we use the standard
npm
package (sudo apt install nodejs npm
) it works fine.The text was updated successfully, but these errors were encountered: