Skip to content

lint-staged command is not found #618

@fayfang

Description

@fayfang

when I use package.json below, the output is 'lint-staged command is not found'

{
  "husky": {
    "hooks": {
      "pre-commit": "lint-staged"
    }
  },
  ...
}

when I use the npm command like this, It work

{
  "scripts": {
    "lint": "lint-staged"
  },
  "husky": {
    "hooks": {
      "pre-commit": "npm run lint"
    }
  },
  ...
}

How can I fix it up?

OS: windows
terminal: git bash
git version: 2.17

$ HUSKY_DEBUG=1 git commit
PS D:\Users\fangyy001\Desktop\project\veb-third-web\cmbwp> git commit
husky > pre-commit (node v12.13.0)
'lint-staged' 不是内部或外部命令,也不是可运行的程序

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions