npm run deploy忽略钩子 [英] npm run deploy ignore hooks

查看:169
本文介绍了npm run deploy忽略钩子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在提交更改时,我遇到了错误.

I was getting below error while committing the changes.

仅添加.pre-commit-config.yaml文件或删除.git\hooks文件夹并不能解决我的问题.所以我在提交时添加了--no-verify选项,它解决了我的问题.

Simply adding .pre-commit-config.yaml file or deleting .git\hooks folder was not resolving my problem. So I added --no-verify option while committing and it solved my problem.

现在,我正在尝试将我的react应用程序部署到Github Pages.运行npm run deploy时,出现如下图所示的错误.

Now, I am trying to deploy my react app to Github Pages. When I run npm run deploy I get the same error as shown in the below picture.

npm run deploy时如何添加--no-verify选项?仅仅添加.pre-commit-config.yaml文件或删除.git\hooks文件夹并不能解决问题.

How I can add --no-verify option while npm run deploy? Simply adding .pre-commit-config.yaml file or deleting .git\hooks folder is not resolving the problem.

我不想尝试pre-commit uninstall命令,因为该命令可能会全局卸载pre-commit.

I don't want to try pre-commit uninstall command because the command might uninstall the pre-commit globally.

是否有其他方法可以在本地禁用特定于当前存储库的挂钩?

Is there any alternative to disable the hooks locally specific to the current repository?

修改: 我也尝试了pre-commit uninstall.当我执行npm run deploy时仍会引发相同的错误.

I tried pre-commit uninstall as well. Still throws the same error when I do npm run deploy.

推荐答案

该消息应来自c:\dev\react-apps\find-my-event\.git\hooks\pre-commit

为了进行测试,您可以将pre-commit重命名为pre-commit.old,然后查看npm run deploy是否仍然受到同一错误消息的影响.

For testing, you can rename pre-commit to pre-commit.old and see if the npm run deploy is still affected by the same error message.

话虽如此,如果您使用 pre-commit/pre-commit python frmaework管理和维护多语言的预提交钩子,然后问题457 明确状态:

That being said, if you are using the pre-commit/pre-commit python frmaework for managing and maintaining multi-language pre-commit hooks., then issues 457 cleary states:

您需要其中之一来告诉pre-commit您要运行的钩子.
要了解如何配置一个,请参见 http://pre-commit.com

You need one of those to tell pre-commit what hooks you want to run.
To see how to configure one, see http://pre-commit.com

例如,至少 :

  • Create a file named .pre-commit-config.yaml
  • you can generate a very basic configuration using pre-commit sample-config

这篇关于npm run deploy忽略钩子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆