ant-design / ant-design-pro

👨🏻‍💻👩🏻‍💻 Use Ant Design like a Pro!
https://pro.ant.design
MIT License
36.51k stars 8.15k forks source link

🧐[问题]husky: Command failed. #5876

Closed whg517 closed 4 years ago

whg517 commented 4 years ago

🧐 husky: Command failed.

I'll start by outlining the problem, and then the actual operation and the output

Problem description:

Create a new directory, execute yarn create umi in the directory, install the dependency yarn install, and report an error. But at this point, you can execute the 'yarn start' project. If you execute yarn run fetch:blocks, an error is reported on the third block insert and you cannot proceed. Look at the recurrence in detail.

It was found that husky is related to git commit through search, I checked #5080 and guessed that my directory was not a git repository. After executing git init , it was normal to rerun yarn install . However, I want to talk about one problem here. yarn create umi is usually followed by yarn install . Now, git init is needed in the middle. It feels strange if you can directly git init without being able to yarn create umi .

Although using git to manage projects is a common understanding for most people, it is not ruled out that some projects are not initialized with git init, or some beginners do not use git. However, there is no specific or guiding prompt for such a question, so it is hard to avoid making people a little crazy when looking for the question. For example, I am not very familiar with what husky is used for, but I also do a temporary demo, and the previous project did not appear this problem, so I delayed a little time.

It is recommended to add some hints to this problem, whether in the documentation or to catch exceptions. Make use more comfortable. thank you

Here's the problem recurring, so I'm not following the normal template:

中文 最开始我先简述一下问题,后面是实际操作和输出。 问题出现: 新建目录,在目录中执行 `yarn create umi`后安装依赖 `yarn install`,然后报错。但是这时候是可以执行 `yarn start` 运行项目的。如果执行 `yarn run fetch:blocks`, 会在 insert 第三个 block 的时候报错而且无法继续进行。详细看后面复现。 通过查找发现 `husky` 和 git commit 有关,查看了 #5080 猜测我的目录不是一个 git 仓库,执行了 `git init` 后重新运行 `yarn install` 正常了。不过这里我想说一个问题, `yarn create umi` 后一般就直接 `yarn install`,现在要在中间 `git init` 一下。如果直接先 `git init ` 又无法 `yarn create umi` ,感觉怪怪的。 虽然使用 git 管理项目是大部分人的一个共识,但不排除一些在初始化项目的时候还没来得及 git init ,或者一些新手并没有用 git。而报出这种问题没有具体或者带有引导性的提示信息,在查找问题的时候难免会让人有点抓狂。就比如我不是一个很熟悉 `husky` 这个是干嘛用的人,又临时做一个demo,而且以前的项目没有出现过这个问题,就耽误了一点时间。 建议对这个问题增加一些提示,无论是文档中,或者捕获异常都行。让使用更舒畅。谢谢。 下面是问题复现,我就不按正常模板写了:

error

 kevin@kevin  /tmp/test  mkdir antd_pro
 kevin@kevin  /tmp/test  cd antd_pro 
 kevin@kevin  /tmp/test/antd_pro  ls
 kevin@kevin  /tmp/test/antd_pro  
 kevin@kevin  /tmp/test/antd_pro  
 kevin@kevin  /tmp/test/antd_pro  yarn -v
1.17.3
 kevin@kevin  /tmp/test/antd_pro  yarn create umi
yarn create v1.17.3
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-umi@0.19.0" with binaries:
      - create-umi
? Select the boilerplate type ant-design-pro
? Which language do you want to use? TypeScript
> git clone https://github.com/ant-design/ant-design-pro --depth=1 /tmp/test/antd_pro
> Clean up...
✨ File Generate Done
Done in 13.15s.
 kevin@kevin  /tmp/test/antd_pro  yarn install
yarn install v1.17.3
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @ant-design/pro-layout > antd > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning @ant-design/pro-layout > antd > rc-tree-select > rc-trigger > rc-animate > fbjs > core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > core-js@2.6.9: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > decamelize > xregexp > @babel/runtime-corejs2 > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > umi-notify > is-ali-env > superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
warning umi > umi-build-dev > sylvanas > @umijs/fabric > stylelint > postcss-markdown > remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
warning umi-plugin-react > umi-plugin-polyfills > core-js@2.6.0: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-plugin-react > umi-plugin-locale > react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-types > @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!
warning umi-types > @types/xterm@3.0.0: This is a stub types definition for xterm.js (https://github.com/sourcelair/xterm.js/). xterm.js provides its own type definitions, so you don't need @types/xterm installed!
warning umi-types > @types/webpack-chain@5.2.0: This is a stub types definition. webpack-chain provides its own type definitions, so you do not need this installed.
[3/5] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi@1.6.0" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0".
warning "@umijs/fabric > eslint-plugin-react@7.13.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/eslint-plugin@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/parser@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint@6.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-flowtype@3.x".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint-plugin-react@^7.14.2".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "@typescript-eslint/parser@^1.9.0".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "eslint@^5.0.0".
warning "@umijs/fabric > eslint-config-egg > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "@umijs/fabric > eslint-config-airbnb-base@13.2.0" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "umi-plugin-react > umi-plugin-dva > dva-loading@3.0.6" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning "umi-plugin-react > umi-plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x".
warning " > jsdom-global@3.0.2" has unmet peer dependency "jsdom@>=10.0.0".
[5/5] Building fresh packages...
[10/11] ⠐ husky
[8/11] ⠐ node-pty
[11/11] ⠐ puppeteer
[-/11] ⠐ waiting...
error /tmp/test/antd_pro/node_modules/husky: Command failed.
Exit code: 1
Command: node husky install
Arguments: 
Directory: /tmp/test/antd_pro/node_modules/husky
Output:

 ✘ kevin@kevin  /tmp/test/antd_pro  yarn run fetch:blocks
yarn run v1.17.3
$ pro fetch-blocks && npm run prettier
✔ 🧐  find config.ts ...
✔ 📦  install login  to: /user/login
✔ 📦  install register  to: /user/register
✔ 📦  install register.result  to: /user/register-result
✔ 📦  install analysis  to: /dashboard/analysis
✔ 📦  install monitor  to: /dashboard/monitor
✔ 📦  install workplace  to: /dashboard/workplace
✔ 📦  install basicform  to: /form/basic-form
✔ 📦  install stepform  to: /form/step-form
✔ 📦  install advancedform  to: /form/advanced-form
✔ 📦  install searchtable  to: /list/table-list
✔ 📦  install basiclist  to: /list/basic-list
✔ 📦  install cardlist  to: /list/card-list
✔ 📦  install search-list  to: /list/search
✔ 📦  install articles  to: /list/search/articles
✔ 📦  install projects  to: /list/search/projects
✔ 📦  install applications  to: /list/search/applications
✔ 📦  install basic  to: /profile/basic
✔ 📦  install advanced  to: /profile/advanced
✔ 📦  install success  to: /result/success
✔ 📦  install fail  to: /result/fail
✔ 📦  install not-permission  to: /exception/403
✔ 📦  install not-find  to: /exception/404
✔ 📦  install server-error  to: /exception/500
✔ 📦  install center  to: /account/center
✔ 📦  install settings  to: /account/settings
✔ 📦  install flow  to: /editor/flow
✔ 📦  install mind  to: /editor/mind
✔ 📦  install koni  to: /editor/koni
✔ 🎁  insert BasicLayout success
✔ 🎁  insert RightContent success
npm install --registry=https://registry.npm.taobao.org
⠋ 🚚  install dependencies package(node:26047) UnhandledPromiseRejectionWarning: Error: Command failed with exit code 1: npm install --registry=https://registry.npm.taobao.org
    at makeError (/tmp/test/antd_pro/node_modules/@ant-design/pro-cli/node_modules/execa/lib/error.js:56:11)
    at Function.module.exports.sync (/tmp/test/antd_pro/node_modules/@ant-design/pro-cli/node_modules/execa/index.js:188:17)
    at Function.module.exports.commandSync (/tmp/test/antd_pro/node_modules/@ant-design/pro-cli/node_modules/execa/index.js:227:15)
    at execCmd (/tmp/test/antd_pro/node_modules/@ant-design/pro-cli/src/fetch-blocks/index.js:72:16)
    at module.exports (/tmp/test/antd_pro/node_modules/@ant-design/pro-cli/src/fetch-blocks/index.js:180:3)
    at processTicksAndRejections (internal/process/task_queues.js:89:5)
(node:26047) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:26047) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
⠼ 🚚  install dependencies package(node:26047) UnhandledPromiseRejectionWarning: FetchError: request to https://registry.npmjs.org/ failed, reason: read ECONNRESET
    at ClientRequest.<anonymous> (/tmp/test/antd_pro/node_modules/node-fetch/lib/index.js:1455:11)
    at ClientRequest.emit (events.js:200:13)
    at TLSSocket.socketErrorListener (_http_client.js:410:9)
    at TLSSocket.emit (events.js:200:13)
    at emitErrorNT (internal/streams/destroy.js:91:8)
    at emitErrorAndCloseNT (internal/streams/destroy.js:59:3)
    at processTicksAndRejections (internal/process/task_queues.js:84:9)
(node:26047) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
error Command failed with exit code 130.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

fine

 kevin@kevin  /tmp/test/antd_pro  git init 
已初始化空的 Git 仓库于 /tmp/test/antd_pro/.git/
 kevin@kevin  /tmp/test/antd_pro   master  
 kevin@kevin  /tmp/test/antd_pro   master  
 kevin@kevin  /tmp/test/antd_pro   master  yarn install      
yarn install v1.17.3
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @ant-design/pro-layout > antd > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning @ant-design/pro-layout > antd > rc-tree-select > rc-trigger > rc-animate > fbjs > core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > core-js@2.6.9: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > decamelize > xregexp > @babel/runtime-corejs2 > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > umi-notify > is-ali-env > superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
warning umi > umi-build-dev > umi-test > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning umi > umi-build-dev > sylvanas > @umijs/fabric > stylelint > postcss-markdown > remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
warning umi-plugin-react > umi-plugin-polyfills > core-js@2.6.0: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > umi-plugin-locale > react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-types > @types/webpack-chain@5.2.0: This is a stub types definition. webpack-chain provides its own type definitions, so you do not need this installed.
warning umi-types > @types/xterm@3.0.0: This is a stub types definition for xterm.js (https://github.com/sourcelair/xterm.js/). xterm.js provides its own type definitions, so you don't need @types/xterm installed!
warning umi-types > @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!
[3/5] Fetching packages...
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi@1.6.0" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0".
warning "@umijs/fabric > eslint-plugin-react@7.13.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/eslint-plugin@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/parser@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint@6.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-flowtype@3.x".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "@typescript-eslint/parser@^1.9.0".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "eslint@^5.0.0".
warning "@umijs/fabric > eslint-config-egg > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "@umijs/fabric > eslint-config-airbnb-base@13.2.0" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint-plugin-react@^7.14.2".
warning "umi-plugin-react > umi-plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x".
warning "umi-plugin-react > umi-plugin-dva > dva-loading@3.0.6" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning " > jsdom-global@3.0.2" has unmet peer dependency "jsdom@>=10.0.0".
[5/5] Building fresh packages...
success Saved lockfile.
Done in 60.23s.
 kevin@kevin  /tmp/test/antd_pro   master  
SIvaCoHan commented 4 years ago

Meeting the same problem

whg517 commented 4 years ago

The problem recurred when I was operating in a new system environment. Even though I used what I thought was the right thing to do

[root@iZ2zedpo29j86sp10axjroZ test]# yarn create umi
yarn create v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-umi@0.19.0" with binaries:
      - create-umi
? Select the boilerplate type ant-design-pro
? Which language do you want to use? TypeScript
> git clone https://github.com/ant-design/ant-design-pro --depth=1 /tmp/test
events.js:298
      throw er; // Unhandled 'error' event
      ^

Error: spawn git ENOENT
    at Process.ChildProcess._handle.onexit (internal/child_process.js:267:19)
    at onErrorNT (internal/child_process.js:469:16)
    at processTicksAndRejections (internal/process/task_queues.js:84:21)
Emitted 'error' event on AntDesignProGenerator instance at:
    at Immediate.<anonymous> (/usr/local/share/.config/yarn/global/node_modules/yeoman-generator/lib/index.js:451:18)
    at processImmediate (internal/timers.js:456:21) {
  errno: -2,
  code: 'ENOENT',
  syscall: 'spawn git',
  path: 'git',
  spawnargs: [
    'clone',
    'https://github.com/ant-design/ant-design-pro',
    '--depth=1',
    '/tmp/test'
  ],
  stdout: '',
  stderr: '',
  failed: true,
  signal: null,
  cmd: 'git clone https://github.com/ant-design/ant-design-pro --depth=1 /tmp/test',
  timedOut: false,
  killed: false
}
error Command failed.
Exit code: 1
Command: /usr/local/bin/create-umi
Arguments: 
Directory: /tmp/test
Output:

info Visit https://yarnpkg.com/en/docs/cli/create for documentation about this command.
[root@iZ2zedpo29j86sp10axjroZ test]# git ini^C
[root@iZ2zedpo29j86sp10axjroZ test]# yum install git
已加载插件:fastestmirror
Loading mirror speeds from cached hostfile
正在解决依赖关系
--> 正在检查事务
---> 软件包 git.x86_64.0.1.8.3.1-20.el7 将被 安装
--> 正在处理依赖关系 perl-Git = 1.8.3.1-20.el7,它被软件包 git-1.8.3.1-20.el7.x86_64 需要
--> 正在处理依赖关系 perl(Term::ReadKey),它被软件包 git-1.8.3.1-20.el7.x86_64 需要
--> 正在处理依赖关系 perl(Git),它被软件包 git-1.8.3.1-20.el7.x86_64 需要
--> 正在处理依赖关系 perl(Error),它被软件包 git-1.8.3.1-20.el7.x86_64 需要
--> 正在检查事务
---> 软件包 perl-Error.noarch.1.0.17020-2.el7 将被 安装
---> 软件包 perl-Git.noarch.0.1.8.3.1-20.el7 将被 安装
---> 软件包 perl-TermReadKey.x86_64.0.2.30-20.el7 将被 安装
--> 解决依赖关系完成

依赖关系解决

=====================================================================================================================================================================================================================
 Package                                                  架构                                           版本                                                     源                                            大小
=====================================================================================================================================================================================================================
正在安装:
 git                                                      x86_64                                         1.8.3.1-20.el7                                           base                                         4.4 M
为依赖而安装:
 perl-Error                                               noarch                                         1:0.17020-2.el7                                          base                                          32 k
 perl-Git                                                 noarch                                         1.8.3.1-20.el7                                           base                                          55 k
 perl-TermReadKey                                         x86_64                                         2.30-20.el7                                              base                                          31 k

事务概要
=====================================================================================================================================================================================================================
安装  1 软件包 (+3 依赖软件包)

总下载量:4.5 M
安装大小:22 M
Is this ok [y/d/N]: y
Downloading packages:
(1/4): perl-Error-0.17020-2.el7.noarch.rpm                                                                                                                                                    |  32 kB  00:00:00     
(2/4): perl-Git-1.8.3.1-20.el7.noarch.rpm                                                                                                                                                     |  55 kB  00:00:00     
(3/4): perl-TermReadKey-2.30-20.el7.x86_64.rpm                                                                                                                                                |  31 kB  00:00:00     
(4/4): git-1.8.3.1-20.el7.x86_64.rpm                                                                                                                                                          | 4.4 MB  00:00:00     
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
总计                                                                                                                                                                                  16 MB/s | 4.5 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  正在安装    : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                1/4 
  正在安装    : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                              2/4 
  正在安装    : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                        3/4 
  正在安装    : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                   4/4 
  验证中      : perl-Git-1.8.3.1-20.el7.noarch                                                                                                                                                                   1/4 
  验证中      : 1:perl-Error-0.17020-2.el7.noarch                                                                                                                                                                2/4 
  验证中      : git-1.8.3.1-20.el7.x86_64                                                                                                                                                                        3/4 
  验证中      : perl-TermReadKey-2.30-20.el7.x86_64                                                                                                                                                              4/4 

已安装:
  git.x86_64 0:1.8.3.1-20.el7                                                                                                                                                                                        

作为依赖被安装:
  perl-Error.noarch 1:0.17020-2.el7                                    perl-Git.noarch 0:1.8.3.1-20.el7                                    perl-TermReadKey.x86_64 0:2.30-20.el7                                   

完毕!
[root@iZ2zedpo29j86sp10axjroZ test]# yarn create umi
yarn create v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Installed "create-umi@0.19.0" with binaries:
      - create-umi
? Select the boilerplate type ant-design-pro
? Which language do you want to use? TypeScript
> git clone https://github.com/ant-design/ant-design-pro --depth=1 /tmp/test
> Clean up...
✨ File Generate Done
Done in 51.06s.
[root@iZ2zedpo29j86sp10axjroZ test]# git init
初始化空的 Git 版本库于 /tmp/test/.git/
[root@iZ2zedpo29j86sp10axjroZ test]# yarn install
yarn install v1.21.1
info No lockfile found.
[1/5] Validating package.json...
[2/5] Resolving packages...
warning @ant-design/pro-layout > omit.js > babel-runtime > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning @ant-design/pro-layout > antd > rc-tree-select > rc-trigger > rc-animate > fbjs > core-js@1.2.7: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > core-js@2.6.9: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > decamelize > xregexp > @babel/runtime-corejs2 > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi > umi-build-dev > umi-notify > is-ali-env > superagent@3.8.3: Please note that v5.0.1+ of superagent removes User-Agent header by default, therefore you may need to add it yourself (e.g. GitHub blocks requests without a User-Agent header).  This notice will go away with v5.0.2+ once it is released.
warning umi > umi-build-dev > umi-test > jest-cli > jest-config > jest-environment-jsdom > jsdom > left-pad@1.3.0: use String.prototype.padStart()
warning umi > umi-build-dev > umi-uni18n > @umijs/fabric > stylelint > postcss-markdown > remark > unified > @types/vfile > @types/vfile-message@2.0.0: This is a stub types definition. vfile-message provides its own type definitions, so you do not need this installed.
warning umi-plugin-react > umi-plugin-polyfills > core-js@2.6.0: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi@11.4.0: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > umi-plugin-locale > react-intl > intl-relativeformat@2.2.0: This package has been deprecated, please see migration guide at 'https://github.com/formatjs/formatjs/tree/master/packages/intl-relativeformat#migration-guide'
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo@2.0.2: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning umi-plugin-react > workbox-webpack-plugin > workbox-build > joi > topo > hoek@4.2.1: This version has been deprecated in accordance with the hapi support policy (hapi.im/support). Please upgrade to the latest version to get the best features, bug fixes, and security patches. If you are unable to upgrade at this time, paid support is available for older versions (hapi.im/commercial).
warning jest-puppeteer > jest-environment-puppeteer > jest-dev-server > wait-on > core-js@2.6.11: core-js@<3 is no longer maintained and not recommended for usage due to the number of issues. Please, upgrade your dependencies to the actual version of core-js@3.
warning umi-types > @types/xterm@3.0.0: This is a stub types definition for xterm.js (https://github.com/sourcelair/xterm.js/). xterm.js provides its own type definitions, so you don't need @types/xterm installed!
warning umi-types > @types/webpack-chain@5.2.0: This is a stub types definition. webpack-chain provides its own type definitions, so you do not need this installed.
warning umi-types > @types/moment@2.13.0: This is a stub types definition for Moment (https://github.com/moment/moment). Moment provides its own type definitions, so you don't need @types/moment installed!
[3/5] Fetching packages...
warning file-loader@2.0.0: Invalid bin field for "file-loader".
warning umi-url-pnp-loader@1.1.2: Invalid bin field for "umi-url-pnp-loader".
warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js").
info fsevents@2.1.2: The platform "linux" is incompatible with this module.
info "fsevents@2.1.2" is an optional dependency and failed compatibility check. Excluding it from installation.
info fsevents@1.2.11: The platform "linux" is incompatible with this module.
info "fsevents@1.2.11" is an optional dependency and failed compatibility check. Excluding it from installation.
[4/5] Linking dependencies...
warning "dva > connected-react-router@6.5.2" has unmet peer dependency "react-router@^4.3.1 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi@1.6.0" has incorrect peer dependency "eslint-plugin-react-hooks@1.5.0".
warning "@umijs/fabric > eslint-plugin-react@7.13.0" has incorrect peer dependency "eslint@^3.0.0 || ^4.0.0 || ^5.0.0".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/eslint-plugin@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has unmet peer dependency "@typescript-eslint/parser@2.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint@6.x".
warning "umi > umi-build-dev > af-webpack > eslint-config-umi > eslint-config-react-app@5.0.2" has incorrect peer dependency "eslint-plugin-flowtype@3.x".
warning "@umijs/fabric > eslint-config-airbnb-base@13.2.0" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint@^4.19.1 || ^5.3.0".
warning "@umijs/fabric > eslint-config-airbnb@17.1.1" has incorrect peer dependency "eslint-plugin-react@^7.14.2".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "@typescript-eslint/parser@^1.9.0".
warning "@umijs/fabric > @typescript-eslint/eslint-plugin@1.13.0" has incorrect peer dependency "eslint@^5.0.0".
warning "@umijs/fabric > eslint-config-egg > @typescript-eslint/eslint-plugin > tsutils@3.17.1" has unmet peer dependency "typescript@>=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta".
warning "umi-plugin-react > umi-plugin-dva > babel-plugin-dva-hmr@0.4.2" has unmet peer dependency "redbox-react@1.x".
warning "umi-plugin-react > umi-plugin-dva > dva-loading@3.0.6" has unmet peer dependency "dva-core@^1.1.0 | ^1.5.0-0 | ^1.6.0-0".
warning " > jsdom-global@3.0.2" has unmet peer dependency "jsdom@>=10.0.0".
[5/5] Building fresh packages...
[9/11] ⢀ preact
[10/11] ⢀ husky
[8/11] ⢀ node-pty
[6/11] ⢀ styled-components
error /tmp/test/node_modules/husky: Command failed.
Exit code: 1
Command: node husky install
Arguments: 
Directory: /tmp/test/node_modules/husky
Output:

[root@iZ2zedpo29j86sp10axjroZ test]#
13796986399 commented 4 years ago

Meeting the same problem

afc163 commented 4 years ago

https://github.com/typicode/husky/issues/636

whg517 commented 4 years ago

I find that if I delete husky from devDependencies, everything works fine。

yoyo837 commented 4 years ago

It has been reverted in v4.0.6.

whg517 commented 4 years ago

It has been reverted in v4.0.6.

But and.desgin is using v4.0.0 in the main branch https://github.com/ant-design/ant-design-pro/blob/0a41c6ea55164054f9561c05465076687397bb8b/package.json#L100