Skip to content

Precommit hooks don’t work #1734

Closed
Closed

Description

@sapegin

GitHub Desktop can’t run precommit hook, at least when using husky.

Description

I can’t commit anything using GitHub Desktop. I have this in my package.json:

{
  // ...
  "devDependencies": {
    "husky": "^0.13.3",
    "lint-staged": "~3.4.2",
  },
  "scripts": {
    "precommit": "lint-staged"
  }
}

Version

GitHub Desktop version: 0.5.7

OS version: 10.12.5

Steps to Reproduce

  1. Try to commit any changes via GitHub Desktop having a precommit hook.

Expected behaviour:

No errors when precommit hooks return no error.

Actual behaviour:

I see this error:

Commit failed - exit code 1 received, with output: '> husky - npm run -s precommit

env: node: No such file or directory

> husky - pre-commit hook failed (add --no-verify to bypass)
> husky - to debug, use 'npm run precommit''

(npm run precommit works fine. I can commit via command line without any issues.)

Reproduces how often:

Always.

Logs

I don’t have any logs for today.

Activity

  1. niik commented on May 24, 2017

    @niik
    Member

    I believe this is another problem with our Git shell not inheriting environment variables such as PATH on Windows, cc #1578 (comment)

  2. sapegin commented on May 24, 2017

    @sapegin
    Author

    Looks like so! ;-)

  3. joshaber commented on May 26, 2017

    @joshaber
    Contributor

    I'm gonna roll this into #1796 so that we can track the underlying cause.

  4. locked as resolved and limited conversation to collaborators on Jul 22, 2018
  5. unlocked this conversation on Sep 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions