Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 [BUG] npm run i18n-remove 报错 #10497

Closed
Capricair opened this issue Jan 13, 2023 · 3 comments
Closed

🐛 [BUG] npm run i18n-remove 报错 #10497

Capricair opened this issue Jan 13, 2023 · 3 comments
Labels

Comments

@Capricair
Copy link

🐛 bug 描述

npm run i18n-remove 报错

📷 复现步骤 | Recurrence steps

  1. pro create my-app
  2. tyarn
  3. npm run i18n-remove

🏞 期望结果 | Expected results

执行成功

💻 复现代码 | Recurrence code

© 版本信息

  • Ant Design Pro 版本: 6.0.0
  • umi 版本: 4.x
  • 浏览器环境: Chrome
  • 开发环境: node 16.16.0

🚑 其他信息

> ant-design-pro@6.0.0 i18n-remove
> pro i18n-remove --locale=zh-CN --write

E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:784
            throw error;
            ^

Error: Failed to load config "prettier" to extend from.
Referenced from: BaseConfig
    at configInvalidError (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:290:9)
    at ConfigArrayFactory._loadExtendedShareableConfig (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:883:23)
    at ConfigArrayFactory._loadExtends (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:781:25)
    at ConfigArrayFactory._normalizeObjectConfigDataBody (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:720:25)
    at _normalizeObjectConfigDataBody.next (<anonymous>)
    at ConfigArrayFactory._normalizeObjectConfigData (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:665:20)
    at _normalizeObjectConfigData.next (<anonymous>)
    at ConfigArrayFactory.create (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\config-array-factory.js:460:16)
    at createBaseConfigArray (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\cascading-config-array-factory.js:98:48)
    at new CascadingConfigArrayFactory (E:\temp\ant-design-pro-6\node_modules\@ant-design\pro-cli\node_modules\@eslint\eslintrc\lib\cascading-config-array-factory.js:234:30) {
  messageTemplate: 'extend-config-missing',
  messageData: { configName: 'prettier', importerName: '' }
}
@testnet0
Copy link

same error

@wfrhwave
Copy link

看这个Issue #10452

@chenshuai2144
Copy link
Collaborator

TAutomatically replying with ChatGPT can be attempted, but it cannot be guaranteed to be completely accurate and may not fully address all issues. Please feel free to reply if you have any further questions or concerns.
此回复基于 ChatGPT 自动生成,可以尝试下方案,官方人员会在一定时间后继续继续处理。

根据该Issue,报错信息是“Failed to load config "prettier" to extend from. ”,可能是因为缺少Prettier的相关依赖。

你可以先通过以下命令安装Prettier的相关依赖:

npm i --save-dev prettier eslint-config-prettier eslint-plugin-prettier

如果安装完成后还是有报错,你可以尝试升级Prettier版本:

npm install --save-dev --save-exact prettier

最后,别忘记重启npm!

如果上述方法还是无法解决问题,建议检查一下你的eslint的配置,可能是eslint的config配置有误导致的。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants