После создания приложения React с приложением yarn dlx create-react-app, при первом нажатии yarn start, чтобы запустить его, я получаю сообщение об ошибке

Используйте пряжу 2 (пряжа кг / ягода).

  • в терминале
      % yarn set version berry
% yarn dlx create-react-app apple
% cd apple
% yarn start
  • в браузере
      Failed to compile
Failed to load config "react-app" to extend from.
Referenced from: D:\Projects\apple\package.json
This error occurred during the build time and cannot be dismissed.

Как мне решить эту проблему?

пс. yarn dlx create-next-app отлично работает. есть проблема только с CRA

2 ответа

create-react-app в настоящее время уже включает eslint-config-react-app. Так добавили, что привело к конфликту

      Plugin "react" was conflicted between "package.json » eslint-config-react-app » C:\Users\bhalb\programming\activity-tracker\.yarn\__virtual__\eslint-config-react-app-virtual-8e12459b5a\0\cache\eslint-config-react-app-npm-7.0.0-1ad319c3be-dac130cfcb.zip\node_modules\eslint-config-react-app\base.js" and "BaseConfig » C:\Users\bhalb\programming\activity-tracker\.yarn\__virtual__\eslint-config-react-app-virtual-6f6769fb06\0\cache\eslint-config-react-app-npm-7.0.0-1ad319c3be-dac130cfcb.zip\node_modules\eslint-config-react-app\base.js".

Мое решение состояло в том, чтобы отключить plug'n'play, установив nodeLinker: node-modulesв .yarnrc.yml

Перед yarn start добавление шага yarn add eslint-create-react-app решил эту проблему для меня

Другие вопросы по тегам