4

我正在尝试使用 'husky' 来实现 git 挂钩。我安装了 husky 作为开发依赖项,并在脚本对象中包含了一个命令。当我尝试运行命令“ git commit ”时,我收到以下错误:

 $git commit -m "first commit"
unable to setup input stream: unable to set IO streams as raw terminal: The 
handle is invalid.  

我的 package.json 文件如下:

    {
  "name": "project",
  "version": "1.0.0",
  "description": "",
  "main": "index.js",
  "scripts": {
    "test": "echo \"Error: no test specified\" && exit 1",
    "precommit":"npm run test"
  },
  "author": "",
  "license": "ISC",
  "devDependencies": {
    "husky": "~1.0.0-rc.15"
  }
}

我的期望是运行测试命令,但出现错误。

请帮忙!

提前致谢

4

0 回答 0