Ant-design-pro: Commit failed!

Created on 25 Feb 2019  ·  8Comments  ·  Source: ant-design/ant-design-pro

How do I solve this problem ?
It shows when I commit some changes!!!

× node ./scripts/lint-prettier.js found some errors. Please fix them and try committing again.

E:\idea\test\ant-design-pro\scripts\lint-prettier.js:44
  .finally(() => {
          ^

TypeError: Promise.all(...).then(...).catch(...).finally is not a function
  at files.forEach.file (E:\idea\test\ant-design-pro\scripts\lint-prettier.js:44:13)
  at Array.forEach (<anonymous>)
  at Object.<anonymous> (E:\idea\test\ant-design-pro\scripts\lint-prettier.js:18:7)
  at Module._compile (module.js:652:30)
  at Object.Module._extensions..js (module.js:663:10)
  at Module.load (module.js:565:32)
  at tryModuleLoad (module.js:505:12)
  at Function.Module._load (module.js:497:3)
  at Function.Module.runMain (module.js:693:10)
  at startup (bootstrap_node.js:191:16)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] lint-staged: `lint-staged`
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] lint-staged script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

Most helpful comment

@jdfdcc You can use NVM to manage multiple versions of node. The solution is indeed to upgrade your local node version to 10.15 or higher.

Suggestion: As most of us are developers and can speak and write english, maybe it's a good idea to start using English as main language instead of Chinese. This way we will get a much more active and international community!

All 8 comments

I didn't modify other file . I just add a new line!

I've got same issue as well. Seems like the lint check code is faulty.
@anLA7856 you can bypass pre commit check to commit.

将 node 的版本升级到 10.15 + 就可以了

将 node 的版本升级到 10.15 + 就可以了

Think you!! It works! @zhgqthomas

除了升级node 还有其他的办法吗?

你可以删除
ant-design-pro\scripts\lint-prettier.js
的finally 方法,改成顺序执行不用finally

@jdfdcc You can use NVM to manage multiple versions of node. The solution is indeed to upgrade your local node version to 10.15 or higher.

Suggestion: As most of us are developers and can speak and write english, maybe it's a good idea to start using English as main language instead of Chinese. This way we will get a much more active and international community!

研究半天,原来如此

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Yoping picture Yoping  ·  3Comments

cheung1111 picture cheung1111  ·  3Comments

gaoqiang19514 picture gaoqiang19514  ·  3Comments

renyi818 picture renyi818  ·  3Comments

suifan picture suifan  ·  3Comments