-
Notifications
You must be signed in to change notification settings - Fork 72
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
Possible issue with pre-commit + npm + spawn env #80
Comments
If I switch everything out to yarn, this happens:
Does not fail but still causes an error somewhere. |
I found this to be a problem only in Windows (on AppVeyor hosts, specifically). Runs on linux (TravisCI) and OS X do not exhibit this problem. The cheesy workaround is to add |
You could also filter |
@sudo-suhas I've cloned the repository that you have created but I was unable to reproduce the error on Windows.
I'm running node v8.9. Could you please help me reproduce? |
This is very odd but I am not able to reproduce the issue either. I am no longer seeing |
When
cross-spawn
is invoked in apre-commit
hook code by husky, if theprocess.env
is used, npm command errors out inexplicably on windows:On manually removing the silent(
-s
) flag in the husky pre-commit hook(subl ./.git/hooks/pre-commit
), we can see the error logs:npm error logs
I faced and fixed these issues in a couple of places. The solution was to filter
process.env
forundefined
values:I have created a repo for demonstrating the issue - https://github.com/sudo-suhas/test-cross-spawn-env
I am not entirely sure if this is a problem which
cross-spawn
should handle. Thoughts?cc @kentcdodds
The text was updated successfully, but these errors were encountered: